•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 401,691 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,752 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.
Views: 4845 | Replies: 0
![]() |
•
•
Join Date: Jul 2005
Posts: 38
Reputation:
Rep Power: 4
Solved Threads: 1
hi,
can anyone tell me what's wrong with my code or show me a working code to add in to my program so that i can study and understand how the code actually works..
after i type in textbox, i want to be able to hit "enter" key instead of clicking on the button.. i do not mean that i want to disable clicking on the button.. i just want to let user be able to hit "enter" too.. my textBox is named textBox4, button is button3 and after the button is hit, it should open a tab page called tabPage6 under tabControl1...
private void button3_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar==(char)13)
{
this.GetNextControl(textBox4,true).Focus();
tabControl1.Focus();
tabControl1.SelectedTab=tabPage6;
e.Handled=true;
}
}
thanks!
can anyone tell me what's wrong with my code or show me a working code to add in to my program so that i can study and understand how the code actually works..
after i type in textbox, i want to be able to hit "enter" key instead of clicking on the button.. i do not mean that i want to disable clicking on the button.. i just want to let user be able to hit "enter" too.. my textBox is named textBox4, button is button3 and after the button is hit, it should open a tab page called tabPage6 under tabControl1...
private void button3_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar==(char)13)
{
this.GetNextControl(textBox4,true).Focus();
tabControl1.Focus();
tabControl1.SelectedTab=tabPage6;
e.Handled=true;
}
}
thanks!
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- reading a char from keyboard without pressing "Enter"??? (C)
- Capturing "Enter" key event in C# windows application (C#)
- Replacing "Enter" in textBox (ASP.NET)
- google "keyword" question (Search Engine Optimization)
- why i have to press "enter" twice before getline can read the string... (C++)
Other Threads in the C# Forum
- Previous Thread: Form values
- Next Thread: painting on top of custom components


Linear Mode