超难问题!!!!!!!! 如何判断 edit 控件的 光标 在第几个字符上???????????????????? 急!!!!!!!!!!!!
解决方案 »
- 泉州的请进啊.有要事请教!!
- 两个ACCESS数据库如何将一个的数据合并到另一个!
- 如何修改主窗体在任务栏显示名称
- 请问怎么显示数据库中的图像字段?
- 在放分200贺一下
- delphi6或sql server里取月末最后一天的日期 或者 取这个月的天数的函数是?
- 求将个位数格式化为两位字符,如1格式化为'01'的方法
- C++的DLL如何给DELPHI调用问题,分数大赠送!附送‘春宫图’一张
- D7的bug真多,我找出的一些bug及解决方法。
- 请问在Query中用like查询一个字段的值应该怎样写?
- 我的毕业设计是用Delphi或其它工具做一个停车场收费管理系统,现在我不知道怎么入手?请大侠们帮助!
- 如何用文件流读\写\查一个二进制文件?
光标获取
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,SHELLAPI;type
TForm1 = class(TForm)
Memo1: TMemo;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
LineNum:longint;
CharsBeforeLine:longint;
begin
LineNum := SendMessage(Memo1.Handle,EM_LINEFROMCHAR,
Memo1.SelStart,0);
CharsBeforeLine:=SendMessage(Memo1.Handle,EM_LINEINDEX,
LineNum,0);
Label1.Caption:='Line: '+IntToStr(LineNum + 1);
Label2.Caption:='Position: '+IntToStr((Memo1.SelStart -
CharsBeforeLine)+1);
end;
end.