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;
Kod: Tümünü seç
function MyTimem(StrTime: TTime): Time;
begin
StrTime:= Edit1.Text+1;
end;
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;