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

相关阅读 >>

Delphi system.fillchar - 填充字节

android : assets与res/raw资源目录的区别

Delphi图片上写水印文字函数

Delphi写入txt

Delphi fastreport快速入门

Delphi 运行js

Delphi opendialog文件过滤类型

Delphi 判断文件名是否有效

Delphi xe6新增特性及功能

Delphi 按字符串长度对tstringlist的元素进行排序

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...