textbox focus

  • Thread starter Thread starter zdavid
  • Start date Start date
Z

zdavid

Hi,

I have a dialog box with a multiline textbox and three buttons. The
obvious thing I'm suffering with is how to give focus to the textbox,
so that when the dialogbox pops up, the user could immediately start
typing without having to click in the textbox.
I tried textBox.Focus(), textBox.SelectAll() with no success... The
tabindex of the textbox is set to 0, which should mean that the
textbox would have the focus when the dialogbox is shown....But it
isn't focused.

Any ideas?
 
Are you using a groupbox? If the textbox is inside you need to set focus
to the groupbox first, then the textbox.
 
Back
Top