Hi
I have a form with text boxes and a button.
I have set the tabindex - but the textbox with tabindex set to 1 is not the first thing active when i press tab.
Newbies hay - hope thats not so abvious to fix. lol
There is no default focus - so I have to manual select the terxt box and i want ot be automatically be selected after pressing a radio buton. How do i set the focus for this and can pressing enter move the focu to the next text box? How can i make pressing enter in the last textbox run the click event of a button (what do u sed as the arguments, sender and e?
Hope that makes sence.
Regards.
Loading
VulpesPosted Apr 7, 2011, 10:15 AM
Richard BrennanPosted Apr 7, 2011, 9:01 AM
VulpesPosted Apr 7, 2011, 4:55 AM
this.AcceptButton = button1;
Richard BrennanPosted Apr 6, 2011, 6:44 PM
VulpesPosted Apr 6, 2011, 5:33 PM
If you want the size of the controls to change in proportion to the change in the form's size, then you'll need to set their Anchor properties - see http://msdn.microsoft.com/en-us/library/system.windows.forms.control.anchor.aspx
Richard BrennanPosted Apr 6, 2011, 4:38 PM
can i change the form accept button property in code. The form can be made bigger and more txtboxes appear - if t his happens a diffeent button accepting enter would be useful.
While I'm here - what the easiest way to make it things look less - old windows style? If the answer is WPF or XML i will have to leave that w while.
VulpesPosted Apr 6, 2011, 11:01 AM
You can force focus onto a control like this:
textBox1.Focus();
If you set the Form's AcceptButton property to the appropriate Button, then it will be clicked automatically when the user presses ENTER.