Вниз
Скачать: CL | DM;

TEdit - курсор   Найти похожие ветки 

 
rel_   (2004-01-29 10:55) [0]

Мастера, подскажите, как высчитать расстояние между курсором и левым краем Edit"а.


 
[lamer]Barmaglo   (2004-01-29 11:20) [1]

http://www.delphimaster.ru/cgi-bin/faq.pl?look=1&id=988624334&n=17 - выясняешь позицию.

Длинну текста получаешь примерно так:


procedure TForm1.Button1Click(Sender: TObject);
var
s: String;
begin
s:="W";
Edit1.text:=inttostr(Form1.Canvas.TextWidth(s));
end;


 
Zz_   (2004-01-29 11:23) [2]

var pc,pe:TPoint;
begin
GetCaretPos(pc);
Windows.ClientToScreen(Edit1.handle,pc);

pe.x := Edit1.left; pe.y := Edit1.top;
Windows.ClientToScreen(Form1.handle,pe);

Application.MessageBox(PChar(IntToStr(pc.x-pe.x)),"",0);


 
rel_   (2004-01-29 11:35) [3]

Спасибо !!!



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.017 c
6-29489
Dimman1
2003-12-07 19:08
2004.02.10
Sniffer


14-29531
Alex_Bredin
2004-01-21 10:44
2004.02.10
Дейт.Введение в БД. Null - да или нет?


8-29479
VoLung
2003-10-06 23:55
2004.02.10
Как сделать слайдшоу?


7-29628
mmmaloy
2003-11-24 14:13
2004.02.10
Реестр


3-29202
Paul
2003-12-26 14:53
2004.02.10
Откючение ctrl+alt+del в XP




   Наверх