Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How can I create for example button's in a groupbox ? In VB6 there was the container option, but according to VB.NET it's read only here. How can I do that ? The button's are designed during run-time

 

Regards,

Antoine

  • *Gurus*
Posted

Every control has a Controls collection, which is a collection of all its child controls. In VB6 the form has one controls collection of all the controls on it, in .NET this has changed. The answer to your question is to do

 

myGroupBox.Controls.Add(myButton)

 

Instead of

 

Me.Controls.Add(myButton)

MVP, Visual Developer - .NET

 

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

 

My free .NET Windows Forms Controls and Articles

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