mouse kontrol

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
dilo
Üye
Mesajlar: 1
Kayıt: 03 Şub 2017 09:10

mouse kontrol

Mesaj gönderen dilo »

Selam; kullanıcı edit içindeki saati mause topu ile kontrol etmek istiyorum saat artacak veya azalacak;
Fakat bir türlü mouse kontrolünü sağlayamayabileceğim kod bulamadım, acaba bu kontrolü nasıl sağlaya bilirim?


Kod: Tümünü seç

function MyTimem(StrTime: TTime): Time;
begin
StrTime:= Edit1.Text+1;
end;
onur2x
Üye
Mesajlar: 19
Kayıt: 29 Şub 2016 12:20

Re: mouse kontrol

Mesaj gönderen onur2x »

Kod: Tümünü seç


procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
var i: SmallInt; x:Integer ;
begin
if Msg.message = WM_MOUSEWHEEL then
begin
Msg.message := WM_KEYDOWN;
Msg.lParam := 0;
i := HiWord(Msg.wParam);
if i > 0 then begin
if ActiveControl is TEdit then begin
try
x:=StrToIntDef(TEdit(ActiveControl).Text,0) ;
if x>0 then Dec(x) ;
Edit1.Text:=IntToStr(x) ;
//TEdit(ActiveControl).Text:=IntToStr(x) ;//Aktif edit için (çoklu edit)
except
end ;
end ;
end
else begin
if ActiveControl is TEdit then begin
try
x:=StrToIntDef(TEdit(ActiveControl).Text,0) ;
inc(x) ;
//TEdit(ActiveControl).Text:=IntToStr(x) ;//Aktif edit için (çoklu edit)
Edit1.Text:=IntToStr(x) ;
except
end ;
end ;
end ;
Handled := False;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := Form1.AppMessage;
end;




Cevapla