你说的是Webform吗?:TextBox1.SetFocus()

解决方案 »

  1.   

    textbox1.focus()?? 不能使用就有点怪了,功能类似的还有一个:Select():
    textbox1.select();
      

  2.   

    为什么不能使用呢?textbox1.focus()多好啊
    SendKeys.Send("");
      

  3.   

    还是不对
    大家看看
    textBoxCaptcha.Text = "";
    textBoxCaptcha.Focus();
    MessageBox.Show(textBoxCaptcha.Focused.ToString());老是false
      

  4.   

    SendMessage函数
    用底层点的 试试
      

  5.   

    textBoxCaptcha.Text = ""; 
    textBoxCaptcha.Focus(); 
    //MessageBox.Show(textBoxCaptcha.Focused.ToString()); 
    Console.WriteLine(textBoxCaptcha.Focused);使用MessageBox会失文本框再次失去焦点。
    但使用Console.WriteLine方法会很好的完成任务。也不需要你使用ToString()。
      

  6.   

    使用异步!请参考以下:private void PingToolsForm_Load(object sender, EventArgs e)
            {
                this.BeginInvoke(new delegateSetFocus(SetFocus), cmbDestination);
            }        private delegate void delegateSetFocus(ToolStripComboBox ctrl);        void SetFocus(ToolStripComboBox ctrl)
            {
                ctrl.Focus();
            }