Click to See Complete Forum and Search --> : picturebox , scrolling image on mouse move
mohamed123
July 28th, 2008, 04:18 AM
Hi
Jumped to C# now from C++
Any tips on programming how to scroll a picture image in a picture box control ?
Regards
foamy
July 28th, 2008, 05:05 AM
Do you simply want to show scroll bars in the control or something more fancy?
mohamed123
July 28th, 2008, 05:17 AM
Its a simple application which has a picturebox control
and the image is loaded OnLoad
i have added vscroll and hscroll bars and i can scoll with these bar on mouse click
i just need to make the image scroll on mouse wheel events
i m getting into grip how to handle mousewheel events
and one more que. how to add events in Visual C#Express 2008
i m used to that old MFC styl in VC6 of adding events from classwizard which is somewhat missing in Visual C#Express 2008
regards
foamy
July 28th, 2008, 05:25 AM
The scrollbars:
Add a Panel control to your form.
Place the Picturebox inside this panel (Do not use the "Dock in Parent container property!).
Set the Panel's Autoscroll property to True.
Set the Picturebox's SizeMode property to AutoSize.
Done.
To handle events in Visual Studio 2008, access the properties for the control you wish to handle an event, then click the Events tab (lightning icon) and select the event you want to hande from the list.
I'm used to working in VS2005 so there might be some small changes :)
mohamed123
July 28th, 2008, 06:46 AM
thanx for that
but what u told is already done
i wanted to know how to scroll down with mousewheel i.e middle mouse wheel
in your solution when i set autoscroll to true , the mouse wheel scroll does not work
foamy
July 28th, 2008, 07:00 AM
Excellent question. I must have misunderstood you...
I'm sorry to say that I have no knowledge of how to solve this
code?
July 28th, 2008, 04:08 PM
Ah, yes... I would think that you could add a hidden panel on top and on bottom, so when the mouse is on those, it automatically scrolls up or down.
I wish they had a mousescroll event.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.