G
Guest
Hi,
I'm showing a usercontrol containing a textbox on the screen by clicking a
notifyIcon in the taskpane.
I use textBox.Focus() to set the focus for the texbox, and I also get a
blinking text cursor in the textbox. However. I have to click on the
usercontrol before it gets the input so that I can type text in the textbox.
I would really much like to be able to wirte in the textbox immediately after
clicking the notify icon. I've tryed to set the focus to the user control
also, but this doesn't help. Any suggestions.
code snippet:
private void notifyIcon1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left )
{
FormShortcut form = new FormShortcut();
form.tb_proj.Focus();
form.Show();
}
else
{
System.Environment.Exit( System.Environment.ExitCode );
}
}
I'm showing a usercontrol containing a textbox on the screen by clicking a
notifyIcon in the taskpane.
I use textBox.Focus() to set the focus for the texbox, and I also get a
blinking text cursor in the textbox. However. I have to click on the
usercontrol before it gets the input so that I can type text in the textbox.
I would really much like to be able to wirte in the textbox immediately after
clicking the notify icon. I've tryed to set the focus to the user control
also, but this doesn't help. Any suggestions.
code snippet:
private void notifyIcon1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left )
{
FormShortcut form = new FormShortcut();
form.tb_proj.Focus();
form.Show();
}
else
{
System.Environment.Exit( System.Environment.ExitCode );
}
}