|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Custom coordinatesI want to be able to create 2 custom coordinate systems. In one, I want the
origin to be at the center of the form so that there will be 4 quadrants. In another, I want the origin to be at the left edge of the form halfway between the top & the bottom. How do I do that? Thank you. David Inherit from FORM and override the Location property and modify the
resulting X and Y location based on the form's height and width. HUH??? I don't understand !!! What are you talking about? VB6 made it so
much easier! Please elaborate. Please include the source code. In one of my books, I read about scaling & rotation & transformation. Is that what I use? What is the source code? Thank you. David Show quoteHide quote "Steven Nagy" wrote: > Inherit from FORM and override the Location property and modify the > resulting X and Y location based on the form's height and width. > > Ok first you need to learn about 'Inheritance'. Google for that one.
What you will want to do is create your OWN base form to inherit from in the future. By default, when you create a new form, it inherits from System.Windows.Forms.Form You then need to create your own location property by over riding the existing one (another Object Oriented principle) and when you right the X Y properties, just alter them by +/- VALUE where VALUE is exactly half the width/height of the form (width for X, height for Y). You can get those 2 values from teh forms Width and Height properties. No code for you because I'm not able to write windows apps from this workstation. |
|||||||||||||||||||||||