Inputbox Focus

  • Thread starter Thread starter David Webb
  • Start date Start date
D

David Webb

Hi,

Is it possible to have set focus automatically when using an Inputbox?
At present, I call the inputbox function and the user has to click in
the box before they type.

Thanks in advance.

Regards,

David.
 
What you can do is call the Focus method of the control. For instance, on a
form load event you can set the focus to your textbox like this:

private void Form1_Load(object sender, System.EventArgs e)
{
textBox1.Focus();
}

In this case, when the form is loaded textBox1 will automatically receive
focus.
 
Hi Maarten,

Thanks for your reply but its not a textbox. Its just the InputBox
method (cousin of Messagebox) which produces a white screen with the
prompt and a box similar to a textbox. I'm using setfocus when using
textbox controls, but here it is simply a call to the inputbox.

Regards,

David.
 
If it is not focused automatically, it looks like a bug. I guess you will
have to end up creating your own inputbox equivalent
 
Back
Top