469,945 Members | 2,249 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

mousewheel event in VC++.NET

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
Feb 28 '06 #1
4 3493
Check out the 'MouseWheel' event in MSDN.
you basically use it like this:
this->panel1->MouseWheel += gcnew
System::Windows::Forms::MouseEventHandler( this,
&Form1::panel1_MouseWheel );

you can also do this in the properties box of the picture box normally. if
you doubleclick the event the designer will automatically generate the event
handler for you.
strangly enough the MouseWheel event does not show up there (in new winforms
project in VC++2005), but you can add it programmatically.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
"tlemcenvisit" <tl**********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
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

Feb 28 '06 #2
I want to say that the event onwheel does not appear in the properties box of
the picture box !
The events onmouseclick, onmousemove, onmousedoubleclick appear but not
onwheel !
I tried to make it by programming, it is compiled but it is not executed !
Please, what is the problem?
"Bruno van Dooren" wrote:
Check out the 'MouseWheel' event in MSDN.
you basically use it like this:
this->panel1->MouseWheel += gcnew
System::Windows::Forms::MouseEventHandler( this,
&Form1::panel1_MouseWheel );

you can also do this in the properties box of the picture box normally. if
you doubleclick the event the designer will automatically generate the event
handler for you.
strangly enough the MouseWheel event does not show up there (in new winforms
project in VC++2005), but you can add it programmatically.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
"tlemcenvisit" <tl**********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
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


Mar 1 '06 #3
pictureBox did not have the focus, now it's good, but the event onmousewheel
isn't present in the properties window.
Mar 1 '06 #4
> pictureBox did not have the focus, now it's good, but the event
onmousewheel
isn't present in the properties window.


I know, but you can add it manually in your form constructor.
You can see this in the example that is included with the MouseWheel event
topic in MSDN.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 1 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by deko | last post: by
1 post views Thread by Niranjan | last post: by
7 posts views Thread by Daisy | last post: by
1 post views Thread by Qwert | last post: by
1 post views Thread by Nicholas Shewmaker | last post: by
3 posts views Thread by Dave K | last post: by
reply views Thread by WaterWalk | last post: by
1 post views Thread by =?Utf-8?B?UmljaA==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.