Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
19
Answers
Set Focus Problem With Usercontrol(DGV) And Other Controls(textBox)
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
mahesh waghela
13y
6.7k
1
Reply
I have a user control Datagridview which is derived from windows.forms.datagridview class and Textbox control in my forms and I have set the tabindex of control as below
Datagridview------ tabindex = 0
Textbox------------ tabindex =1
I have set mydatagridview as enter key like tab behavior and it's works fine but problem is that how to set focus on textbox control which is on main form by enterkey.
The code of Setting DGV by Enter keys as below:
public class mydatagridview : DataGridView
{
protected override bool ProcessDataGridViewKey(KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.ProcessTabKey(e.KeyData);
return true;
}
return base.ProcessDataGridViewKey(e);
}
protected override bool ProcessDialogKey(Keys keyData)
{
if (keyData == Keys.Enter)
{
this.ProcessTabKey(keyData);
return true;
SendKeys.Send("{tab}");
}
return base.ProcessDialogKey(keyData);
}
}
How to Set Focus on Textbox by Enterkey on my main forms?.
Post
Reset
Cancel
Answers (
19
)
Next Recommended Forum
Hi this will be easy for you guys - Linq Insert - Please Help
C#.net new applicaiton