如题,如果对textbox里的内容全选了,在程序里如何判断已经全选还是未全选

解决方案 »

  1.   

     if (this.textBox1.SelectionLength == this.textBox1.Text.Length && this.textBox1.Text.Length !=0)
                {
                    
                }
      

  2.   

    if   (this.textBox1.SelectionLength   ==   this.textBox1.Text.Length   &&   this.textBox1.Text.Length   !=0) 
                            { 
                                    
                            }
      

  3.   

    2楼的这种方法可以行,斑竹。
    textBox1.SelectionLength 表示你选择中文本长度。
    textBox1.Text.Length 表示文本框中文字的长度。
    这个两个相等那就说明是全选了。
      

  4.   

    textBox1.SelectionLength和textBox1.Text.Length相等就行了
      

  5.   

    textBox1.SelectionLength和textBox1.Text.Length相等就行了