MouseWheel & ScrollBars

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daisy

    MouseWheel & ScrollBars

    I've got a control with a scrollbar docked to the right-hand side. The
    scrollbar works fine, I've got an event:

    bottomControlVS croll.Scroll += new
    ScrollEventHand ler(HandleBotto mThingScroll);

    Which calls this.Invalidate () on my control, and all is good. However, the
    MouseWheel does naff all. I understand this is probably because my mouse is
    over my control, and not the scrollbar. How can I set the MouseWheel event
    on my control to pass to the ScrollBar, where the .Value is updated, and my
    control invalidated & repainted?

    --
    Daisy The Cow
    Now playing: Ultrabeat - Pretty Green Eyes


  • Hector Yunier

    #2
    MouseWheel & ScrollBars

    [color=blue]
    >-----Original Message-----
    >I've got a control with a scrollbar docked to the right-[/color]
    hand side. The[color=blue]
    >scrollbar works fine, I've got an event:
    >
    >bottomControlV Scroll.Scroll += new
    >ScrollEventHan dler(HandleBott omThingScroll);
    >
    >Which calls this.Invalidate () on my control, and all is[/color]
    good. However, the[color=blue]
    >MouseWheel does naff all. I understand this is probably[/color]
    because my mouse is[color=blue]
    >over my control, and not the scrollbar. How can I set[/color]
    the MouseWheel event[color=blue]
    >on my control to pass to the ScrollBar, where the .Value[/color]
    is updated, and my[color=blue]
    >control invalidated & repainted?
    >
    >--
    >Daisy The Cow
    >Now playing: Ultrabeat - Pretty Green Eyes
    >[/color]

    Make the MouseWheel event of your control, go to
    your HandleBottomThi ngScroll() method.

    I hope this help.....

    Comment

    • Daisy

      #3
      Re: MouseWheel & ScrollBars

      "Daisy" <daisy@nospam.o ops> wrote in message
      news:bek9jp$3hk $1@linux01.dann ytuppeny.com...[color=blue]
      > I've got a control with a scrollbar docked to the right-hand side. The
      > scrollbar works fine, I've got an event:[/color]
      <snip>

      Scrap that, the wheel works now, I altered .Value depending on e.Delta :o)

      Anyways, the only problem now, is that it only works while my mouse is over
      the scrollbar, and not anywhere in my control. I even added:

      this.MouseWheel += new MouseEventHandl er(HandleBottom ThingWheel);

      In the Constructor, and it still doesn't work for the control :(
      Any ideas?
      --
      Daisy The Cow
      Now playing: Eminem - Lose Yourself


      Comment

      • Daisy

        #4
        Re: MouseWheel &amp; ScrollBars

        "Hector Yunier" <hmartinezd@uci .cu> wrote in message
        news:02e601c347 11$efe16c90$a30 1280a@phx.gbl.. .[color=blue]
        > Make the MouseWheel event of your control, go to
        > your HandleBottomThi ngScroll() method.
        >
        > I hope this help.....[/color]

        It does now:

        bottomControlVS croll.Scroll += new
        ScrollEventHand ler(HandleBotto mThingScroll);
        bottomControlVS croll.MouseWhee l += new
        MouseEventHandl er(HandleBottom ThingWheel);
        this.MouseWheel += new MouseEventHandl er(HandleBottom ThingWheel);

        But the wheel still only works when over the scrollbar :-((
        --
        Daisy The Cow
        Now playing: Flip & Fill - I Wanna Dance With Somebody


        Comment

        • Trevor

          #5
          Re: MouseWheel &amp; ScrollBars

          I am not sure if you have already tried this but, is there a way to hook
          into MouseWheel notifications for the window (parent of the scrollbar)
          instead of the scrollbar itself? Then you could simply forward the message
          on to the scrollbar control.

          "Daisy" <daisy@nospam.o ops> wrote in message
          news:bekbkb$46k $1@linux01.dann ytuppeny.com...[color=blue]
          > "Daisy" <daisy@nospam.o ops> wrote in message
          > news:bek9jp$3hk $1@linux01.dann ytuppeny.com...[color=green]
          > > I've got a control with a scrollbar docked to the right-hand side. The
          > > scrollbar works fine, I've got an event:[/color]
          > <snip>
          >
          > Scrap that, the wheel works now, I altered .Value depending on e.Delta :o)
          >
          > Anyways, the only problem now, is that it only works while my mouse is[/color]
          over[color=blue]
          > the scrollbar, and not anywhere in my control. I even added:
          >
          > this.MouseWheel += new MouseEventHandl er(HandleBottom ThingWheel);
          >
          > In the Constructor, and it still doesn't work for the control :(
          > Any ideas?
          > --
          > Daisy The Cow
          > Now playing: Eminem - Lose Yourself
          >
          >[/color]


          Comment

          • Daisy

            #6
            Re: MouseWheel &amp; ScrollBars

            "Trevor" <tbalcom@s-s.com> wrote in message
            news:Od5QYoyRDH A.1720@TK2MSFTN GP10.phx.gbl...[color=blue]
            > I am not sure if you have already tried this but, is there a way to[/color]
            hook[color=blue]
            > into MouseWheel notifications for the window (parent of the scrollbar)
            > instead of the scrollbar itself? Then you could simply forward the[/color]
            message[color=blue]
            > on to the scrollbar control.[/color]

            How do I "forward" them on? I can't call MouseWheel directly?
            --
            Daisy The Cow
            Now playing: Nothing


            Comment

            • Harkos

              #7
              Re: MouseWheel &amp; ScrollBars

              Try creating a composite control (if you're not already using) and
              overriding the OnMouseWheel event. Do everything you need there. Works for
              me.

              []'s,
              Harkos

              "Daisy" <daisy@nospam.o ops> escreveu na mensagem
              news:bekofd$8af $1@linux01.dann ytuppeny.com...[color=blue]
              > "Trevor" <tbalcom@s-s.com> wrote in message
              > news:Od5QYoyRDH A.1720@TK2MSFTN GP10.phx.gbl...[color=green]
              > > I am not sure if you have already tried this but, is there a way to[/color]
              > hook[color=green]
              > > into MouseWheel notifications for the window (parent of the scrollbar)
              > > instead of the scrollbar itself? Then you could simply forward the[/color]
              > message[color=green]
              > > on to the scrollbar control.[/color]
              >
              > How do I "forward" them on? I can't call MouseWheel directly?
              > --
              > Daisy The Cow
              > Now playing: Nothing
              >
              >[/color]


              Comment

              • Daisy

                #8
                Re: MouseWheel &amp; ScrollBars

                "Harkos" <harkos@uol.com .br> wrote in message
                news:OiXq9i5RDH A.2768@tk2msftn gp13.phx.gbl...[color=blue]
                > Try creating a composite control (if you're not already using) and
                > overriding the OnMouseWheel event. Do everything you need there. Works for
                > me.[/color]

                It's ok, it already works. I've got a cráppy Vaio mouse on this laptop,
                along with a USB keyboard with it's own cráppy drivers. Must be them, works
                on every other pc :o)
                --
                Daisy The Cow
                Now playing: Alice Deejay - Better Off Alone


                Comment

                Working...