Can I move GroupBox from a tab to another tab in TabControl?

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
ivan.liao@live.com
Posts: 13
Joined: Sat Mar 09, 2019 4:47 am

Can I move GroupBox from a tab to another tab in TabControl?

Post by ivan.liao@live.com »

Hi Everyone,

I'm want to put some buttons in a GroupBox, and this GroupBox is in one of Tab in a TabControl.
Can I use code to move this GroupBox from Tab1 to Tab2 ?

Actually, I want to create a tab which is hidden tab. And then put some controls in GroupBoxs, and then move it to other tabs when it is needed.

Don't know if there is any other better way to do that?

Thanks in advance!

jvierra
Posts: 14543
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Can I move GroupBox from a tab to another tab in TabControl?

Post by jvierra »

You can copy it from the controls collection on one tab to the controls collection on another tab using the "CopyTo" method of the collection.

ivan.liao@live.com
Posts: 13
Joined: Sat Mar 09, 2019 4:47 am

Re: Can I move GroupBox from a tab to another tab in TabControl?

Post by ivan.liao@live.com »

jvierra wrote:
Fri Jan 10, 2020 4:32 am
You can copy it from the controls collection on one tab to the controls collection on another tab using the "CopyTo" method of the collection.
Thanks for your reply!
But I'm not meaning move GroupBox while design UI via PowerShell Studio. I'm trying to move it by code while script is running. Just don't know how to get it done.

jvierra
Posts: 14543
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Can I move GroupBox from a tab to another tab in TabControl?

Post by jvierra »

"CopyTo" is a programmatic method that we use in code. It is not a part of the designer.

Locked