Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBGrid and MOUSEWHEEL problem

Status
Not open for further replies.

amolrp1

IS-IT--Management
Aug 9, 2004
1
DE
Hallo we have developed a application using Delphi 7. The entire application uses DBGRID. I cannot use mousewheel in DBGRID. I wrote the following code so that the functionality of mousewheel is used in DBGRID for entire application.

procedure TApplication.OnMessage
(var Msg: TMsg; var Handled: Boolean) ;
var
i: SmallInt;
begin
if Msg.message = WM_MOUSEWHEEL then
begin
Msg.message := WM_KEYDOWN;
Msg.lParam := 0;
i := HiWord(Msg.wParam);
if i > 0 then
Msg.wParam := VK_UP
else
Msg.wParam := VK_DOWN;

Handled := False;
end;
end;


But now I am facing a prob. In the above code I am overwritting the message for the mousewheel for entire application with the down and up arrow key. But now in one forms I have map and I have to use the functionality of MouseWheel which is normal zoom in and zoom out for a mousewheel. Is there any way in which I can bring back the funtionality of mousewheel only for one form. Anyway I can modify the above code to understand that the call is from the required form and I have to use the original functionality..

Suggestions will be appretiated..

Thanks in Advance.
 
just override the wndproc() of the forms your are using dbgrids in. then use your nice little trick there. don't forget to call inherited...

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top