473,769 Members | 6,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11515
Post it here when you've done it. I'm sure that others will be interested.
"James" <Ja***@discussi ons.microsoft.c om> wrote in message
news:6B******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:6B******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:E8******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:6B******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:E8******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:6B******** *************** ***********@mic rosoft.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.AutoScrollPo sition:
Me.AutoScrollPo sition = New Point(0,0)

"James" <Ja***@discussi ons.microsoft.c om> wrote in message
news:26******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:E8******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
>> news:6B******** *************** ***********@mic rosoft.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.AutoScrollPo sition:
Me.AutoScrollPo sition = New Point(0,0)

"James" <Ja***@discussi ons.microsoft.c om> wrote in message
news:26******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
news:E8******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
>> news:6B******** *************** ***********@mic rosoft.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.AutoSc rollPosition.X, Me.AutoScrollPo sition.Y +
e.Delta)

Me.AutoScrollPo sition = pt
"James" <Ja***@discussi ons.microsoft.c om> wrote in message
news:2E******** *************** ***********@mic rosoft.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.AutoScrollPo sition:
Me.AutoScrollPo sition = New Point(0,0)

"James" <Ja***@discussi ons.microsoft.c om> wrote in message
news:26******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
>> news:E8******** *************** ***********@mic rosoft.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***@discussi ons.microsoft.c om> wrote in message
>> >> news:6B******** *************** ***********@mic rosoft.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
2227
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, I have a boolean variable (blnMousewheel) that is set to true. In the beforeupdate form event, an If statement cancels any changes if the blnMousewheel is true. It also sets the boolean variable to false. It works most of the time, but some...
0
1247
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 not listed... Any ideas? Is this a bug? What else can I do to react on a mousewheel event...? Thanks, Rud.
0
1049
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 to my control. If my control doesn't have the focus, the MouseWheel event isn't fired for mycontrol. I don't want to set the focus to my control whenever the mouse moves over or even hovers over it. it as that would be impolite to the enduser...
1
4791
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
3826
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 I program that? Thanks in advance
0
1952
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 want to stop default scrollmoving property of panel,so that i can use this event for my picturebox. I donot want to set its autoscroll to false,i want panel's scrollbar to be visible ,but they should'nt function when i scroll mousewheel on
3
3592
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 discuss the mousewheel event... but there doesn't seem to BE a mousewheel event. in VS 2003 or 2005, in C# or in VB.NET... and on the couple systems I've checked. I can't find a single control that gives me a "MouseWheel" event option in it's...
0
2491
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 receives this event and the result showed that only the top Tk widget gets it. This is really annoying. I wonder if this problem exists on other platform. I googled, but found no appliable solution, so I wrote one as following. It's not perfect,...
1
2614
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 the property. If you scroll the mouse wheel, the selected property change as it should, no problem there. But if there are enough properties to generate a vertical scroll bar on the propertygrid, the property change as it should but the scroll...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.