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 flash控件使用

dededl安卓中保持屏幕常亮

Delphi 双击隐藏tabsheet

Delphi实现注册表的操作

Delphi格式化函数format、formatdatetime和formatfloat

Delphi 提取字符中的数字

Delphi之tstrings和tstringlists类

线程与进程的区别

Delphi 在窗口作图的源代码

Delphi 判断文件名是否合法,判断文件名路径是否合法

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



打赏

取消

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

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

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

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

评论

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