Forcing a tab to the next control in an advanced .net control

Let's say I'm extending a TextBox called CustomTextBox in .net. In some situations, I would like to force the tab to the next TabIndex in the form. Is there a way to do this without getting all the controls contained in the parent CustomTextBox, sorting them by TabIndex, and then focusing the next sequence number?

+6
c # events controls winforms
source share
2 answers

I think you are looking for something like the following method:

form1.SelectNextControl(textBox1, true, true, true, true); 

(All truths are just different options, read intellisense!)

Did you really say that these are WinForms, not WebForms?

+12
source share

If you extend the normal Winforms text box, you can set the AcceptsTab property to True or False, depending on your needs. If this is true, a tab character will be inserted in the text box. If it is wrong, then pressing the Tab key will move the focus to the next control in Tab Order

0
source share

All Articles