TEdit onclick全选? [英] TEdit onclick select all?

查看:115
本文介绍了TEdit onclick全选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在用户单击TEdit1或单击以选择其中的某些文本时选择TEdit1的所有文本

How to select all text of a TEdit1 whenever user click on it or click to select some text of it

推荐答案

如何在用户单击时选择TEdit1的所有文本

How to select all text of a TEdit1 whenever user click on it

在VCL编辑器中选择Edit1,然后双击OnClick事件:

Select Edit1 in the VCL editor and double-click on the OnClick event:

procedure TForm13.Edit1Click(Sender: TObject);
begin
  Edit1.SelectAll;
end;

您还可以将此事件链接到另一个控件,例如按钮.
选择按钮,选择并单击V箭头以选择要链接的事件.

You can also link this event to another control like a button.
Select the button, choose and click on the V arrow to select an event you want to link.

现在Edit1.OnClickButton1.OnClick都链接到同一事件.

Now both Edit1.OnClick and Button1.OnClick link to the same event.

这篇关于TEdit onclick全选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆