Custom coordinates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pcnerd

    #1

    Custom coordinates

    I 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
  • Steven Nagy

    #2
    Re: Custom coordinates

    Inherit from FORM and override the Location property and modify the
    resulting X and Y location based on the form's height and width.

    Comment

    • pcnerd

      #3
      Re: Custom coordinates


      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

      "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.
      >
      >

      Comment

      • Steven Nagy

        #4
        Re: Custom coordinates

        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.

        Comment

        Working...