TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mahesh waghela
NA
93
113.8k
Set Focus Problem With Usercontrol(DGV) And Other Controls(textBox)
May 6 2011 8:52 AM
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?.
Reply
Answers (
19
)
Hi this will be easy for you guys - Linq Insert - Please Help
C#.net new applicaiton