下载本文示例代码
1. 取得TMemo 控件当前光标的行和列信息到Tpoint中
function ReadCursorPos(SourceMemo: TMemo): TPoint;
var
Point: TPoint;
begin
point.y := SendMessage(SourceMemo.Handle, EM_LINEFROMCHAR,SourceMemo.SelStart,0);
point.x := SourceMemo.SelStart- SendMessage(SourceMemo.Handle,EM_LINEINDEX,point.y,0);
Result := Point;
end;
2.检查Tmemo控件能否Undo和如何实现Undo功能
Function CanUndo(AMemo: TMemo): Boolean;
Begin
Result := AMemo.Perform(EM_CANUNDO, 0, 0) $#@60;$#@62; 0;
End;
Procedure Undo(Amemo: Tmemo);
Begin
Memo1.Perform(EM_UNDO, 0, 0);
End;
共3页。 1 2 3 8 :
1. 取得TMemo 控件当前光标的行和列信息到Tpoint中
function ReadCursorPos(SourceMemo: TMemo): TPoint;
var
Point: TPoint;
begin
point.y := SendMessage(SourceMemo.Handle, EM_LINEFROMCHAR,SourceMemo.SelStart,0);
point.x := SourceMemo.SelStart- SendMessage(SourceMemo.Handle,EM_LINEINDEX,point.y,0);
Result := Point;
end;
2.检查Tmemo控件能否Undo和如何实现Undo功能
Function CanUndo(AMemo: TMemo): Boolean;
Begin
Result := AMemo.Perform(EM_CANUNDO, 0, 0) $#@60;$#@62; 0;
End;
Procedure Undo(Amemo: Tmemo);
Begin
Memo1.Perform(EM_UNDO, 0, 0);
End;
共3页。 1 2 3 8 :
下载本文示例代码
delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇delphi三十六之编辑篇
阅读(173) | 评论(0) | 转发(0) |