
Delphi : Scrolling DBGrid
Memfungsikan Mouse Scroll pada GRID
- Buat Procedure berikut :
procedure TForm1.MyMessageHandler(var Msg: TMsg; var Handled: Boolean);
begin
if (Msg.message = META_SETTEXTJUSTIFICATION) then
if ActiveControl is TDBGrid then
begin
if msg.wParam >0 then
SendMessage(ActiveControl.Handle,WM_KEYDOWN,VK_UP,0)
else
SendMessage(ActiveControl.Handle,WM_KEYDOWN,VK_DOWN,0);
handled := true;
end
end;
- Tambahkan pada Main Form event Form Create :
Application.OnMessage := MyMessageHandler;
Post a Comment