I've been working a quite a bit with windows forms and have gotten stuck. I've got Ian's ".NET Windows Forms" book and have used it a lot, but I need to find an example of making a window with a menu bar that just displays an image. The Image must resize if the window is resized and also provide scrolling of the image at 100% if an option is turned on in the menu. I've looked at the standard web-sites for examples, but it appears that most people are just introducing you to gdi+ without going into the forms area of doing what I want. Does anybody have an example I can look at?
David,
There is a list entirely for Windows Forms questions ([DOTNET-WINFORMS]), please use it for future WinForms issues.
I don't have an example at hand, but what you are describing doesn't sound too complicated. Take a look at the PictureBox control, which should give you everything you need.
For the resize mode, set the Dock property of the PictureBox to DockStyle.Fill and the SizeMode to PictureBoxSizeMode.StretchImage. For the scroll mode, set the Dock property to DockStyle.None, the SizeMode to AutoSize, and the container's (e.g. Form's) AutoScroll property to true.
Fabian
=================================== This list is hosted by DevelopMentorŪ http://www.develop.com Some .NET courses you may be interested in:
Essential .NET: building applications and components with C# November 29 - December 3, in Los Angeles http://www.develop.com/courses/edotnet
View archives and manage your subscription(s) at http://discuss.develop.com