Link to home
Start Free TrialLog in
Avatar of schenkp
schenkp

asked on

Programmatically Placing a From

Hi,
How do i Programmatically place a form on the screen?  I have a need to place it off center when the program starts?
Avatar of Jase-Coder
Jase-Coder

Hi

You can use the following method:

public static void SetWindowPosition (
      int left,
      int top
)


this method can only be used in .NET 2 and above
ASKER CERTIFIED SOLUTION
Avatar of Jase-Coder
Jase-Coder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of schenkp

ASKER

Can you show me one with values please....
yeh no problem

button a button on a form and do

        private void button1_Click(object sender, EventArgs e)
        {
            this.Top = 20;
            this.Left = 40;
        }