- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 设置文本框中光标的位置在最后
设置光标的位置
edt1.SelStart := Length(edt1.Text);
edt1.SelLength := length(edt1.Text);
虚拟键盘的点击事件
//1、操作的事件
procedure TForm1.JPSR(s:String);
var
i: integer;
p: string;
begin
if s='Del' then
begin
i := Length(edt1.Text);
i := i-1;
edt1.Text := copy(edt1.Text,1,i);
end
else
begin
edt1.Text := edt1.Text + s;
end;
edt1.SelStart := Length(edt1.Text);
edt1.SelLength := length(edt1.Text);
end;
2、//模拟删除最后一个字节
procedure TForm1.lbl3Click(Sender: TObject);
var
s: string;
begin
s := 'Del';
JPSR(s);
end;
3、//输入字节字节
procedure TForm1.lbl1Click(Sender: TObject);
var
s: string;
begin
s := '1';
JPSR(s);
end;
————————————————
原文链接:https://blog.csdn.net/xiongmao000738/article/details/6804500