mousewheel event in VC++.NET

G

Guest

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
 
B

Bruno van Dooren

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.
(e-mail address removed)
Remove only "_nos_pam"
 
G

Guest

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?
 
G

Guest

pictureBox did not have the focus, now it's good, but the event onmousewheel
isn't present in the properties window.
 
B

Bruno van Dooren

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.
(e-mail address removed)
Remove only "_nos_pam"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top