下面的语句,可以高亮显示字符:
    Memo1.SetFocus;
    Memo1.Text := 'dasfasfasf32421342134dafafasdf';
    Memo1.SelStart := 10;
    Memo1.SelLength := 5;
但是当showmessage()的时候高亮显示就没有,怎么才能解决呢?

解决方案 »

  1.   

    object Memo1: TMemo
      HideSelection = False
    end//窗体设计的时候把Memo1.HideSelection设置为False
      

  2.   

    showmessage('a');
      memo1.SetFocus ;
      

  3.   

    1.在showmessage()语句的下面加
    Memo1.SetFocus;2.如上面的兄弟所说,将Memo1.HideSelection设置为False
      

  4.   

    把Memo1的hideselection属性改为false就可以了
      

  5.   

    1.在showmessage()语句的下面加
    Memo1.SetFocus;
    在ShowMessage的时候,不管用的
    2.如上面的兄弟所说,将Memo1.HideSelection设置为False
    这个可以
      

  6.   

    是呀 你showmessage的时候已经没有焦点了,所以不会高亮显示了
      

  7.   

    我也认为是焦点问题!!setFocus!!
      

  8.   

    1.在showmessage()语句的下面加
    Memo1.SetFocus;
    在ShowMessage的时候,不管用的
    2.如上面的兄弟所说,将Memo1.HideSelection设置为False
    我也认为是这个,不过上面的GG们都说了。
      

  9.   

    showmessage('asdfas');
      memo1.SetFocus ;