SelStart是当前选择文字的起始位置,SelLength是当前选择文字
l应该是1吧,这句话就是TmpStr应该是在ComboBox1中取从起始位置取到当前位置,然后除去选择的文字后再取255个字符。

解决方案 »

  1.   

    把 combobox 里高亮选择部分的字符 剔除掉。
      

  2.   

    SelStart: 选中文本的开始位置//从0开始
    SelLength: 选中文本的长度
    SelText: 选中的文本Copy(Text, 1, SelStart); //得到选中位置之前的字符串
    Copy(Text, SelStart + SelLength + 1, MaxInt); //得到选择体之后的字符串比如:
    Text = '1234567890'
    SelStart = 3; SelLength = 3;  //123[|456]7890 //SelText = 456Copy(Text, 1, SelStart); //123
    Copy(Text, SelStart + SelLength + 1, MaxInt); //7890
               3 + 3 + 1 = 7
    //1237890可以看出就是去掉了选中的字符串
      

  3.   

    SelStart: 选中文本的开始位置//从0开始
    SelLength: 选中文本的长度
    SelText: 选中的文本Copy(Text, 1, SelStart); //得到选中位置之前的字符串
    Copy(Text, SelStart + SelLength + 1, MaxInt); //得到选择体之后的字符串比如:
    Text = '1234567890'
    SelStart = 3; SelLength = 3;  //123[|456]7890 //SelText = 456Copy(Text, 1, SelStart); //123
    Copy(Text, SelStart + SelLength + 1, MaxInt); //7890
               3 + 3 + 1 = 7
    //1237890可以看出就是去掉了选中的字符串
      

  4.   

    TmpStr  :=  Copy(Text,1,SelStart)+Copy(Text,SelLength+SelStart+1,255) 
    如果下拉框的選中文字後面的長度大於255,就有問題了.是吧???這是delphi幫助中的example .