TScrollBox and Mouse Wheel

Is there any way to allow the mouse wheel to work in TScrollBox? I hate to use scrollbar to scroll, mouse wheel would be a lot more useful

Thanks....

Comments

  • Use the OnMouseWheel Event:

    [code]
    void __fastcall TForm1::ScrollBox1MouseWheel(TObject *Sender,
    TShiftState Shift, int WheelDelta, TPoint &MousePos, bool &Handled)
    {
    ScrollBox1->VertScrollBar->Position -= WheelDelta;
    }
    [/code]

    Have fun,
    bilderbikkel

  • : Use the OnMouseWheel Event:
    :
    : [code]
    : void __fastcall TForm1::ScrollBox1MouseWheel(TObject *Sender,
    : TShiftState Shift, int WheelDelta, TPoint &MousePos, bool &Handled)
    : {
    : ScrollBox1->VertScrollBar->Position -= WheelDelta;
    : }
    : [/code]
    :
    : Have fun,
    : bilderbikkel
    :
    :
    Thanks man! It didn't work at first though. I put the event on Form, not ScrollBox. Then it was working as i wanted :D
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories