Scroll on MouseWheel Event - VB.NET 1.1

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

    Scroll on MouseWheel Event - VB.NET 1.1

    Hi,

    I have a Windows Forms application which uses multiple child forms (MDI
    interface).

    The height of one of the child forms is larger than the height of the MDI
    client area, so when this form is visible, the vertical scroll bar of the MDI
    parent appears automatically.

    What I want to do is write a routine within the MouseWheel event of the MDI
    parent to scroll the window so that the lower half of the child form comes
    into view. At the moment, my users have to click the scroll bar to do this.

    Regards,

    James
  • Stephany Young

    #2
    Re: Scroll on MouseWheel Event - VB.NET 1.1

    Post it here when you've done it. I'm sure that others will be interested.


    "James" <James@discussi ons.microsoft.c om> wrote in message
    news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...[color=blue]
    > Hi,
    >
    > I have a Windows Forms application which uses multiple child forms (MDI
    > interface).
    >
    > The height of one of the child forms is larger than the height of the MDI
    > client area, so when this form is visible, the vertical scroll bar of the
    > MDI
    > parent appears automatically.
    >
    > What I want to do is write a routine within the MouseWheel event of the
    > MDI
    > parent to scroll the window so that the lower half of the child form comes
    > into view. At the moment, my users have to click the scroll bar to do
    > this.
    >
    > Regards,
    >
    > James[/color]


    Comment

    • James

      #3
      Re: Scroll on MouseWheel Event - VB.NET 1.1

      I can't figure how to do it, which is why I have posted it here. I was rather
      hoping you would tell me...

      "Stephany Young" wrote:
      [color=blue]
      > Post it here when you've done it. I'm sure that others will be interested.
      >
      >
      > "James" <James@discussi ons.microsoft.c om> wrote in message
      > news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...[color=green]
      > > Hi,
      > >
      > > I have a Windows Forms application which uses multiple child forms (MDI
      > > interface).
      > >
      > > The height of one of the child forms is larger than the height of the MDI
      > > client area, so when this form is visible, the vertical scroll bar of the
      > > MDI
      > > parent appears automatically.
      > >
      > > What I want to do is write a routine within the MouseWheel event of the
      > > MDI
      > > parent to scroll the window so that the lower half of the child form comes
      > > into view. At the moment, my users have to click the scroll bar to do
      > > this.
      > >
      > > Regards,
      > >
      > > James[/color]
      >
      >
      >[/color]

      Comment

      • Stephany Young

        #4
        Re: Scroll on MouseWheel Event - VB.NET 1.1

        Then I suggest that you rephrase your problem and actually ask for some
        help.

        All your original post did was make 2 very vague statements.


        "James" <James@discussi ons.microsoft.c om> wrote in message
        news:E8A2A143-F834-4545-8386-E9C699D629FB@mi crosoft.com...[color=blue]
        >I can't figure how to do it, which is why I have posted it here. I was
        >rather
        > hoping you would tell me...
        >
        > "Stephany Young" wrote:
        >[color=green]
        >> Post it here when you've done it. I'm sure that others will be
        >> interested.
        >>
        >>
        >> "James" <James@discussi ons.microsoft.c om> wrote in message
        >> news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...[color=darkred]
        >> > Hi,
        >> >
        >> > I have a Windows Forms application which uses multiple child forms (MDI
        >> > interface).
        >> >
        >> > The height of one of the child forms is larger than the height of the
        >> > MDI
        >> > client area, so when this form is visible, the vertical scroll bar of
        >> > the
        >> > MDI
        >> > parent appears automatically.
        >> >
        >> > What I want to do is write a routine within the MouseWheel event of the
        >> > MDI
        >> > parent to scroll the window so that the lower half of the child form
        >> > comes
        >> > into view. At the moment, my users have to click the scroll bar to do
        >> > this.
        >> >
        >> > Regards,
        >> >
        >> > James[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • James

          #5
          Re: Scroll on MouseWheel Event - VB.NET 1.1

          Stephany,

          I gave some background information to the problem to put it in context. I
          belive I stated the problem quite clearly: "What I want to do is write a
          routine within the MouseWheel event of the MDI parent to scroll the window so
          that the lower half of the child form comes into view."

          Perhaps it is not phrased as well as it could have been, but nevertheless, I
          need help in writing a routine to scroll the parent window when the
          MouseWheel event fires. The MouseWheel event exposes a MouseEventArgs object
          that I can use to detect how much the user has moved the wheel, but how do I
          then scroll the window in response to this? The form does not expose Scroll
          method.

          Regards,

          James



          "Stephany Young" wrote:
          [color=blue]
          > Then I suggest that you rephrase your problem and actually ask for some
          > help.
          >
          > All your original post did was make 2 very vague statements.
          >
          >
          > "James" <James@discussi ons.microsoft.c om> wrote in message
          > news:E8A2A143-F834-4545-8386-E9C699D629FB@mi crosoft.com...[color=green]
          > >I can't figure how to do it, which is why I have posted it here. I was
          > >rather
          > > hoping you would tell me...
          > >
          > > "Stephany Young" wrote:
          > >[color=darkred]
          > >> Post it here when you've done it. I'm sure that others will be
          > >> interested.
          > >>
          > >>
          > >> "James" <James@discussi ons.microsoft.c om> wrote in message
          > >> news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...
          > >> > Hi,
          > >> >
          > >> > I have a Windows Forms application which uses multiple child forms (MDI
          > >> > interface).
          > >> >
          > >> > The height of one of the child forms is larger than the height of the
          > >> > MDI
          > >> > client area, so when this form is visible, the vertical scroll bar of
          > >> > the
          > >> > MDI
          > >> > parent appears automatically.
          > >> >
          > >> > What I want to do is write a routine within the MouseWheel event of the
          > >> > MDI
          > >> > parent to scroll the window so that the lower half of the child form
          > >> > comes
          > >> > into view. At the moment, my users have to click the scroll bar to do
          > >> > this.
          > >> >
          > >> > Regards,
          > >> >
          > >> > James
          > >>
          > >>
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          • Rocky

            #6
            Re: Scroll on MouseWheel Event - VB.NET 1.1

            You set the scroll postion using Me.AutoScrollPo sition:
            Me.AutoScrollPo sition = New Point(0,0)

            "James" <James@discussi ons.microsoft.c om> wrote in message
            news:26C8167C-A0D1-4D7D-9305-561F37555839@mi crosoft.com...[color=blue]
            > Stephany,
            >
            > I gave some background information to the problem to put it in context. I
            > belive I stated the problem quite clearly: "What I want to do is write a
            > routine within the MouseWheel event of the MDI parent to scroll the window
            > so
            > that the lower half of the child form comes into view."
            >
            > Perhaps it is not phrased as well as it could have been, but nevertheless,
            > I
            > need help in writing a routine to scroll the parent window when the
            > MouseWheel event fires. The MouseWheel event exposes a MouseEventArgs
            > object
            > that I can use to detect how much the user has moved the wheel, but how do
            > I
            > then scroll the window in response to this? The form does not expose
            > Scroll
            > method.
            >
            > Regards,
            >
            > James
            >
            >
            >
            > "Stephany Young" wrote:
            >[color=green]
            >> Then I suggest that you rephrase your problem and actually ask for some
            >> help.
            >>
            >> All your original post did was make 2 very vague statements.
            >>
            >>
            >> "James" <James@discussi ons.microsoft.c om> wrote in message
            >> news:E8A2A143-F834-4545-8386-E9C699D629FB@mi crosoft.com...[color=darkred]
            >> >I can't figure how to do it, which is why I have posted it here. I was
            >> >rather
            >> > hoping you would tell me...
            >> >
            >> > "Stephany Young" wrote:
            >> >
            >> >> Post it here when you've done it. I'm sure that others will be
            >> >> interested.
            >> >>
            >> >>
            >> >> "James" <James@discussi ons.microsoft.c om> wrote in message
            >> >> news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...
            >> >> > Hi,
            >> >> >
            >> >> > I have a Windows Forms application which uses multiple child forms
            >> >> > (MDI
            >> >> > interface).
            >> >> >
            >> >> > The height of one of the child forms is larger than the height of
            >> >> > the
            >> >> > MDI
            >> >> > client area, so when this form is visible, the vertical scroll bar
            >> >> > of
            >> >> > the
            >> >> > MDI
            >> >> > parent appears automatically.
            >> >> >
            >> >> > What I want to do is write a routine within the MouseWheel event of
            >> >> > the
            >> >> > MDI
            >> >> > parent to scroll the window so that the lower half of the child form
            >> >> > comes
            >> >> > into view. At the moment, my users have to click the scroll bar to
            >> >> > do
            >> >> > this.
            >> >> >
            >> >> > Regards,
            >> >> >
            >> >> > James
            >> >>
            >> >>
            >> >>[/color]
            >>
            >>
            >>[/color][/color]


            Comment

            • James

              #7
              Re: Scroll on MouseWheel Event - VB.NET 1.1

              Thanks Rocky,

              How do I convert the delta value from the MouseEventArgs object to a Point
              object?

              Regards,

              James

              "Rocky" wrote:
              [color=blue]
              > You set the scroll postion using Me.AutoScrollPo sition:
              > Me.AutoScrollPo sition = New Point(0,0)
              >
              > "James" <James@discussi ons.microsoft.c om> wrote in message
              > news:26C8167C-A0D1-4D7D-9305-561F37555839@mi crosoft.com...[color=green]
              > > Stephany,
              > >
              > > I gave some background information to the problem to put it in context. I
              > > belive I stated the problem quite clearly: "What I want to do is write a
              > > routine within the MouseWheel event of the MDI parent to scroll the window
              > > so
              > > that the lower half of the child form comes into view."
              > >
              > > Perhaps it is not phrased as well as it could have been, but nevertheless,
              > > I
              > > need help in writing a routine to scroll the parent window when the
              > > MouseWheel event fires. The MouseWheel event exposes a MouseEventArgs
              > > object
              > > that I can use to detect how much the user has moved the wheel, but how do
              > > I
              > > then scroll the window in response to this? The form does not expose
              > > Scroll
              > > method.
              > >
              > > Regards,
              > >
              > > James
              > >
              > >
              > >
              > > "Stephany Young" wrote:
              > >[color=darkred]
              > >> Then I suggest that you rephrase your problem and actually ask for some
              > >> help.
              > >>
              > >> All your original post did was make 2 very vague statements.
              > >>
              > >>
              > >> "James" <James@discussi ons.microsoft.c om> wrote in message
              > >> news:E8A2A143-F834-4545-8386-E9C699D629FB@mi crosoft.com...
              > >> >I can't figure how to do it, which is why I have posted it here. I was
              > >> >rather
              > >> > hoping you would tell me...
              > >> >
              > >> > "Stephany Young" wrote:
              > >> >
              > >> >> Post it here when you've done it. I'm sure that others will be
              > >> >> interested.
              > >> >>
              > >> >>
              > >> >> "James" <James@discussi ons.microsoft.c om> wrote in message
              > >> >> news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...
              > >> >> > Hi,
              > >> >> >
              > >> >> > I have a Windows Forms application which uses multiple child forms
              > >> >> > (MDI
              > >> >> > interface).
              > >> >> >
              > >> >> > The height of one of the child forms is larger than the height of
              > >> >> > the
              > >> >> > MDI
              > >> >> > client area, so when this form is visible, the vertical scroll bar
              > >> >> > of
              > >> >> > the
              > >> >> > MDI
              > >> >> > parent appears automatically.
              > >> >> >
              > >> >> > What I want to do is write a routine within the MouseWheel event of
              > >> >> > the
              > >> >> > MDI
              > >> >> > parent to scroll the window so that the lower half of the child form
              > >> >> > comes
              > >> >> > into view. At the moment, my users have to click the scroll bar to
              > >> >> > do
              > >> >> > this.
              > >> >> >
              > >> >> > Regards,
              > >> >> >
              > >> >> > James
              > >> >>
              > >> >>
              > >> >>
              > >>
              > >>
              > >>[/color][/color]
              >
              >
              >[/color]

              Comment

              • Rocky

                #8
                Re: Scroll on MouseWheel Event - VB.NET 1.1

                Dim pt As New Point(Me.AutoSc rollPosition.X, Me.AutoScrollPo sition.Y +
                e.Delta)

                Me.AutoScrollPo sition = pt


                "James" <James@discussi ons.microsoft.c om> wrote in message
                news:2E3FEE08-3A99-4779-8309-C52D388749AC@mi crosoft.com...[color=blue]
                > Thanks Rocky,
                >
                > How do I convert the delta value from the MouseEventArgs object to a Point
                > object?
                >
                > Regards,
                >
                > James
                >
                > "Rocky" wrote:
                >[color=green]
                >> You set the scroll postion using Me.AutoScrollPo sition:
                >> Me.AutoScrollPo sition = New Point(0,0)
                >>
                >> "James" <James@discussi ons.microsoft.c om> wrote in message
                >> news:26C8167C-A0D1-4D7D-9305-561F37555839@mi crosoft.com...[color=darkred]
                >> > Stephany,
                >> >
                >> > I gave some background information to the problem to put it in context.
                >> > I
                >> > belive I stated the problem quite clearly: "What I want to do is write
                >> > a
                >> > routine within the MouseWheel event of the MDI parent to scroll the
                >> > window
                >> > so
                >> > that the lower half of the child form comes into view."
                >> >
                >> > Perhaps it is not phrased as well as it could have been, but
                >> > nevertheless,
                >> > I
                >> > need help in writing a routine to scroll the parent window when the
                >> > MouseWheel event fires. The MouseWheel event exposes a MouseEventArgs
                >> > object
                >> > that I can use to detect how much the user has moved the wheel, but how
                >> > do
                >> > I
                >> > then scroll the window in response to this? The form does not expose
                >> > Scroll
                >> > method.
                >> >
                >> > Regards,
                >> >
                >> > James
                >> >
                >> >
                >> >
                >> > "Stephany Young" wrote:
                >> >
                >> >> Then I suggest that you rephrase your problem and actually ask for
                >> >> some
                >> >> help.
                >> >>
                >> >> All your original post did was make 2 very vague statements.
                >> >>
                >> >>
                >> >> "James" <James@discussi ons.microsoft.c om> wrote in message
                >> >> news:E8A2A143-F834-4545-8386-E9C699D629FB@mi crosoft.com...
                >> >> >I can't figure how to do it, which is why I have posted it here. I
                >> >> >was
                >> >> >rather
                >> >> > hoping you would tell me...
                >> >> >
                >> >> > "Stephany Young" wrote:
                >> >> >
                >> >> >> Post it here when you've done it. I'm sure that others will be
                >> >> >> interested.
                >> >> >>
                >> >> >>
                >> >> >> "James" <James@discussi ons.microsoft.c om> wrote in message
                >> >> >> news:6B4E0B42-1A30-491C-8B1C-1FC7F1842640@mi crosoft.com...
                >> >> >> > Hi,
                >> >> >> >
                >> >> >> > I have a Windows Forms application which uses multiple child
                >> >> >> > forms
                >> >> >> > (MDI
                >> >> >> > interface).
                >> >> >> >
                >> >> >> > The height of one of the child forms is larger than the height of
                >> >> >> > the
                >> >> >> > MDI
                >> >> >> > client area, so when this form is visible, the vertical scroll
                >> >> >> > bar
                >> >> >> > of
                >> >> >> > the
                >> >> >> > MDI
                >> >> >> > parent appears automatically.
                >> >> >> >
                >> >> >> > What I want to do is write a routine within the MouseWheel event
                >> >> >> > of
                >> >> >> > the
                >> >> >> > MDI
                >> >> >> > parent to scroll the window so that the lower half of the child
                >> >> >> > form
                >> >> >> > comes
                >> >> >> > into view. At the moment, my users have to click the scroll bar
                >> >> >> > to
                >> >> >> > do
                >> >> >> > this.
                >> >> >> >
                >> >> >> > Regards,
                >> >> >> >
                >> >> >> > James
                >> >> >>
                >> >> >>
                >> >> >>
                >> >>
                >> >>
                >> >>[/color]
                >>
                >>
                >>[/color][/color]


                Comment

                Working...