L ldelphi Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-10 #1 我的软件中有一 Edit 控件,用于显示数据库中的资料。能否实现这样一个功能:当鼠标移到它上面时,它上面的内容会自动被选中。就好像一打开 QQ 的查看用户信息,用户号码就会自动被选中那样!
S szf Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-10 #2 procedure TForm1.Edit1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin (Sender as TEdit).SetFocus; (Sender as TEdit).SelectAll; end; procedure TForm1.FormShow(Sender: TObject); begin Edit2.SetFocus; Edit2.SelectAll; end;
procedure TForm1.Edit1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin (Sender as TEdit).SetFocus; (Sender as TEdit).SelectAll; end; procedure TForm1.FormShow(Sender: TObject); begin Edit2.SetFocus; Edit2.SelectAll; end;