[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

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?
0
logosapience
Asked:
logosapience
1 Solution
 
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now