Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

When Form2 is called from Form1 how can the starting position of Form2 be in reference to the location of Form1....ie. Form2 starts on the right-hand side of Form1?

 

Thanks :D

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • *Experts*
Posted

You'll need a reference of Form1 inside of Form2 or you can pass in Form1's Location and Size values to Form2. From that, you'll have to manually set Form2's Location based on the values.

 

For example:

// In Form2's constructor, after InitializeComponent
// Assumes "f" is a Form variable that references an instance of Form1, probably passed in through Form2's constructor
this.Location = new Point(f.Left + f.Width, f.Top);

 

Note: Above is untested but looks right

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...