delphi 点击更改按钮如何使memo文本内容处于选中状态?

2024-11-06 03:38:07
推荐回答(2个)
回答1:

Memo1.SelectAll;
//或者如下代码
Memo1.SelStart:=1;
Memo1.SelLength:=45;
Memo1.SetFocus;

回答2:

procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.SelectAll;
Memo1.SetFocus;
end;