Windows Application event help.

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 4K views
sweetjones
Messages
44
Reaction score
0
Hello, I am trying to learn Windows API on my own and I'm having a little trouble. I made an "Enter" button and all I want to do is basically when the user is finished with one textbox, when they press the "Enter" button that I created, i want the cursor to go to the next textbox. I've been looking for something like a tab event, but I can't seem to find such an event, or I don't know what code to put in the function. All I have is this:
private: System::Void btnEnter_Click(System::Object * sender, System::EventArgs * e)
{

}
Can anyone help me please? Again all I want it to do is go from textbox1 to textbox2 to textbox3. Thanx In Advance!
 
Physics news on Phys.org
sweetjones said:
Hello, I am trying to learn Windows API on my own and I'm having a little trouble. I made an "Enter" button and all I want to do is basically when the user is finished with one textbox, when they press the "Enter" button that I created, i want the cursor to go to the next textbox. I've been looking for something like a tab event, but I can't seem to find such an event, or I don't know what code to put in the function. All I have is this:
private: System::Void btnEnter_Click(System::Object * sender, System::EventArgs * e)
{

}
Can anyone help me please? Again all I want it to do is go from textbox1 to textbox2 to textbox3. Thanx In Advance!

Well you didn't provide much frame of reference, but I'm going to assume that this is Visual C++ because of the events. I would recommend use of the Focus() method. Also note, to be focusable, Focusable and IsEnabled must both be true.

MSDN link: http://msdn2.microsoft.com/en-us/library/system.windows.uielement.focus.aspx