473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 11492
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Niranjan | last post by:
I have a data entry form. I am trying to avoid users accidentally using the mouse wheel and saving an incomplete record (or saving record that skips the validation routine). In Mousewheel event,...
0
by: Rud | last post by:
The documentation clearly explains the MouseWheel event for a picturebox. Unfortunately I am not able to select this from the declarations dropdown list for the picturebox control on my form. It's...
0
by: Dennis | last post by:
I have a usercontrol I'm working on and it has several rows of data. I would like to scroll the data when the Mouse moves onto the control and the scroll wheel is turned without setting the focus...
1
by: Qwert | last post by:
Hello, when a NumericUpDown control has the focus, the mousewheel increases/decreases its value. How does one prevent this from happening? How does one turn off its mousewheel event? Thanks.
4
by: tlemcenvisit | last post by:
Hi, I program a windows form application with VC++.NET, I wish to program an event which occurs when the user uses the mouse wheel in a pictureBox control. Which event should I use? And how can...
0
by: Neeraj | last post by:
Hi I have panel and inside the panel i have many picturebox,if number of picturebox increase ,i have set panel's autoscroll property to true,but as and when i click on any of the picturebox ,i...
3
by: Dave K | last post by:
I seem to be missing something... I want to use a mousewheel event in my VB.NET app... and there's a lot of example code on the net showing how to use the mousewheel event... and the .NET docs...
0
by: WaterWalk | last post by:
Hello. When I tried to make Tkinter canvas widget respond to MouseWheel event on Windows XP, I failed. The canvas just doesn't receive MouseWheel event. I used bind_all to find out which widget...
1
by: Tomy Rodrigue | last post by:
Hi everyone, I display some data in a propertygrid using different TypeConverters that I created. Those TypeConverters have different behaviors but they all support the Mouse wheel event to change...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.