•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 456,269 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,427 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 7437 | Replies: 6
![]() |
| |
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 280
Reputation:
Rep Power: 3
Solved Threads: 39
Look at
http://msdn2.microsoft.com/en-us/lib...s.keychar.aspx
then after e.Handled = true; set focus to the next control / textbox.
http://msdn2.microsoft.com/en-us/lib...s.keychar.aspx
then after e.Handled = true; set focus to the next control / textbox.
•
•
Join Date: May 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Look at
http://msdn2.microsoft.com/en-us/lib...s.keychar.aspx
then after e.Handled = true; set focus to the next control / textbox.
thanks for your replay,
but when i press enter corsur hide and don't set next focus.
if (e.KeyChar == (char)13)//press Enter Key
{
Control currCtl = (Control)sender; //current control
e.Handled = true;
Control c = GetNextControl(currCtl, true);
c.Focus();
}
please send the error of this code.
thank you very much..
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 280
Reputation:
Rep Power: 3
Solved Threads: 39
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) { e.Handled = true; Control c = GetNextControl((Control)sender, true); if (c != null) c.Focus(); }
This works fine.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Screen randomly changes focus (Monitors, Displays and Video Cards)
- Change focus in a input grid form (HTML and CSS)
- send keys (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: How to choose printer with StartInfo.Arguments
- Next Thread: Index was out of range>>>>>



Hybrid Mode