delphi richedit 如何在字符中间插入字符?
比如说'1234567890'这时我的光标在按下button1在那里加一个‘0’应该怎么写?...
比如说 '1234567890'这时我的光标在按下button1 在那里加一个‘0’应该怎么写?
展开
1个回答
2013-07-27
展开全部
procedure InsertChar(ARichEdit: TRichEdit;AKey: Char);
begin
ARichEdit.SetFocus;
ARichEdit.Perform(WM_CHAR,Ord(AKey),1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
InsertChar(RichEdit1,'0');
end;
begin
ARichEdit.SetFocus;
ARichEdit.Perform(WM_CHAR,Ord(AKey),1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
InsertChar(RichEdit1,'0');
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询