Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Why is it that when I have a parent form and I try to align a child form to its right edge, it overlaps by a few pixels and I get a horizontal scroll bar? I am aligning it in this way:

 


frmChild.location = new point(frmParent.clientsize.width - frmChild.width , 0)

 

That should put it in the upper left corner. It does, but it overlaps the edge and gives me a horizontal scrollbar in the parent form. So, I wind up having to subtract a few pixels from the LEFT coordinate in order to make it fit properly. Am I doing something wrong?

  • *Experts*
Posted

You need to take into account the border.

 

frmChild.location = New point(frmParent.clientsize.width - frmChild.width - (SystemInformation.BorderSize.Width * 4), 0)

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