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.
This topic is 4 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
ivan.liao@live.com
Posts: 15
Last visit: Wed Jan 19, 2022 4:49 pm

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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: 15
Last visit: Wed Jan 19, 2022 4:49 pm

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 3: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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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.
This topic is 4 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked