wheelmouse & dbgrids

Hello,

I want to manually control a dbgrid with the mousewheel but I can't because the events "onwheeldown.." don't happen when a dbgrid is on the form.

How can I do to disable the automatic wheel handling of the dbgrid?
LVL 1
logosapienceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RadlerCommented:
Delphi 3 or 4 ?

T++, Radler
0
logosapienceAuthor Commented:
Delphi 4...
0
scarle2Commented:
Listening
0
jeurkCommented:
In D4, use the onwheeldown of the form. Is this not enough ?
I using this but I have a problem :
I using the onwheeldown to do a next in my dbgrid,
I have linked other dbcomponents that should refresh
depending on the current record. But they don't.
0
RadlerCommented:
I saw that TDBGrid is a descendent of TWincontrol that have the event "OnMouseWheel"( Delphi 4 ), it's what says the help.
The RXLibrary has a DBGrid that implements this
like


function TRxDBGrid.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean;
begin
  Result := False;
  if Assigned(OnMouseWheelDown) then
    OnMouseWheelDown(Self, Shift, MousePos, Result);
  if not Result then begin
    if not AcquireFocus then Exit;
    if Datalink.Active then begin
      Result := Datalink.DataSet.MoveBy(1) <> 0;
    end;
  end;
end;

function TRxDBGrid.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean;
begin
  Result := False;
  if Assigned(OnMouseWheelUp) then
    OnMouseWheelUp(Self, Shift, MousePos, Result);
  if not Result then begin
    if not AcquireFocus then Exit;
    if Datalink.Active then begin
      Result := Datalink.DataSet.MoveBy(-1) <> 0;
    end;
  end;
end;

Try to use.


T++, Radler.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.