Arkadaslar bir form üzerinde 10 edit ve 10 button var
ben edit1 e cift tıklayınca ve button 1 tek tıklayınca o anki kordinatları almaya calısıyorum
hemen tıklanan yerde bir ufak form gösterecegim
önce global var bloguna
Kod: Tümünü seç
var
Form1: TForm1;
AKL_ListX, AKL_ListY: Integer;//formun acılacagı yer
Kod: Tümünü seç
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
var
Component : TComponent ;
i : integer ;
begin
Case Msg.message Of
WM_LBUTTONDOWN:// tek tıklama
begin
for i := 0 to ComponentCount - 1 do begin
Component:= Components[i] ;
if Component is TButton then begin
if TButton(Component).Name='Button2' then //lazım
if PtInRect(TButton(Component).BoundsRect, ScreenToClient(Msg.pt)) then
begin
AKL_ListX:=Msg.pt.x; //kordinatları gönder
AKL_ListY:=Msg.pt.y;
ShowMessage(' y : '+IntToStr(AKL_ListX) +' x : ' +IntToStr(AKL_ListY) );
end;
end;
end;
end;
WM_LBUTTONDBLCLK:
begin
for i := 0 to ComponentCount - 1 do begin
Component:= Components[i] ;
if Component is TEdit then begin
if TEdit(Component).Name='Edit1' then // lazım
if PtInRect(TEdit(Component).BoundsRect, ScreenToClient(Msg.pt)) then
begin
AKL_ListX:=Msg.pt.x; //kordinatları gönder
AKL_ListY:=Msg.pt.y;
ShowMessage(' yeee : '+IntToStr(AKL_ListX) +' xeee : ' +IntToStr(AKL_ListY) );
end;
end;
end;
end;
end;
end;
ne eksik hatırlamıyorum veya ve yanlıs
hayırlı işler