469,645 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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
Mar 24 '06 #1
7 11266
Post it here when you've done it. I'm sure that others will be interested.
"James" <Ja***@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.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

Mar 24 '06 #2
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" <Ja***@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.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


Mar 24 '06 #3
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" <Ja***@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.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" <Ja***@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.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


Mar 24 '06 #4
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" <Ja***@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.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" <Ja***@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.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


Apr 3 '06 #5
You set the scroll postion using Me.AutoScrollPosition:
Me.AutoScrollPosition = New Point(0,0)

"James" <Ja***@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
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" <Ja***@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.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" <Ja***@discussions.microsoft.com> wrote in message
>> news:6B**********************************@microsof t.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
>>
>>
>>


Apr 3 '06 #6
Thanks Rocky,

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

Regards,

James

"Rocky" wrote:
You set the scroll postion using Me.AutoScrollPosition:
Me.AutoScrollPosition = New Point(0,0)

"James" <Ja***@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
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" <Ja***@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.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" <Ja***@discussions.microsoft.com> wrote in message
>> news:6B**********************************@microsof t.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
>>
>>
>>


Apr 3 '06 #7
Dim pt As New Point(Me.AutoScrollPosition.X, Me.AutoScrollPosition.Y +
e.Delta)

Me.AutoScrollPosition = pt
"James" <Ja***@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Thanks Rocky,

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

Regards,

James

"Rocky" wrote:
You set the scroll postion using Me.AutoScrollPosition:
Me.AutoScrollPosition = New Point(0,0)

"James" <Ja***@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
> 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" <Ja***@discussions.microsoft.com> wrote in message
>> news:E8**********************************@microsof t.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" <Ja***@discussions.microsoft.com> wrote in message
>> >> news:6B**********************************@microsof t.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
>> >>
>> >>
>> >>
>>
>>
>>


Apr 3 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Niranjan | last post: by
reply views Thread by Dennis | last post: by
1 post views Thread by Qwert | last post: by
4 posts views Thread by tlemcenvisit | last post: by
3 posts views Thread by Dave K | last post: by
reply views Thread by WaterWalk | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.