Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When I want to set the left, top, height, width property on a form, I can easily do it.

However, I noticed that when a control is on a groupbox, it takes the dimension of the groupbox to define these properties.

 

example : Label1 on a groupbox at the far right will have the left property set to 10.

 

How do I refer to the groupbox when I set the location at runtime ?

 

thx

What I don't know keeps me excited...
  • *Gurus*
Posted
When you set positions of controls, you are _always_ referring to the bounds within the parent. If you set the .Left property of a Label within a Groupbox, then that coordinate will be relative to the left-hand side of the groupbox.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

OK but suppose that I load all my controls at runtime.

My label does not know that I am about to put it on a groupbox.

Is there a way to add a control to a groupbox ?

What I don't know keeps me excited...

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