Hmm, normally, I just cut all those controls out and delete the GroupBox. But, it's not easy all the time, so me just wondering if there was a way to do it without touching the child controls.
Remove the relationship? Or other otions?

I'm pretty sure the controls will be deleted with their parent. One option you have is to remove the controls from the parent control and place it in a different one or the form itself

For Each c As Control in GroupBox1.Controls
    Me.Controls.Add(c)
Next

You may have to play with location, but everything else should be the same.

I understand your idea, tinstaafl, but then is there a way so we won't have to use code, some property or some... thing?

If you are doing it at design time then just select all child controls, cut, then delete the container, then paste the previously cut controls back on the form.

Well, if there're some hidden forms which being outside form border, what should I do to make sure they still there?

You will have to expand the border (probably both form and container) to see the hidden controls, then copy/paste them from the container onto the form.

@Hearth: Actually, if I want to see all the hidden objects, I can do it better with Document Outline. But Document Outline won't let you keep objects location so it's really annoying.

Well, if there're some hidden forms which being outside form border,

I presume you mean hidden controls rather than hidden forms. Your original question was about controls inside containers. Is this a different question?

Hi,
You can use the dropdown on the properties window to select any controls or forms, even ones you can not see on the screen (simply scroll to the one you want,) upon being selected it will become active and you can cut and paste etc.

@Jim: Yes, it was about objects. Sorry.
@Waddell: I did mentioned the Doc Outline before, and it was better than the property scroll, though.
The thread has become quite long now, thks for great helps, guys :)

Edited 3 Years Ago by Eternal Newbie

This article has been dead for over six months. Start a new discussion instead.