textbox.Focus();
给分,给分!!

解决方案 »

  1.   

    textbox.Focus();我试过了,没用
    textBox1.CanFocus=ture;
    系统提示:无法对属性或索引器“System.Windows.Forms.Control.CanFocus”赋值 -- 它是只读的
      

  2.   

    明白了。原来加载后才可用textbox.Focus();
    但我希望FORM一打开焦点就放在textbox上怎么做那?
      

  3.   

    在窗口初始化时加上textBox.Focus()
      

  4.   

    不行,加载后才可用textbox.Focus();
      

  5.   

    "但我希望FORM一打开焦点就放在textbox上怎么做那"
    对于这个问题,不必使用Focus(),设置控件的TabIndex=0
      

  6.   

    同意楼上的,
    改TabIndex可以用菜单  视图//Tab键顺序   来改的,很方便哦
      

  7.   

    把TextBox的TabIndex设为0就可以了
    Good Luck!
      

  8.   

    yannuaa(yan),不知道你是源码是什么,我的TabIndex=0以后,就可以了.如果不行,下面的这一句一定可以,要放到Form的构造函数中.this.ActiveControl = this.textBox1 ;此属性激活或检索容器控件上的活动控件
      

  9.   

    加两个Button,按一下显示所选的TextBox:
    private void button1_Click(object sender, System.EventArgs e)
    {
    this.textBox1 .Select ();
    } private void button2_Click(object sender, System.EventArgs e)
    {
    this.textBox2 .Select ();
    }