Referring a Tab in Wizard Template for control creation

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 8 years 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
User avatar
dkamra
Posts: 1
Last visit: Wed Jan 18, 2017 11:40 am

Referring a Tab in Wizard Template for control creation

Post by dkamra »

Hi,

I am trying to work with the 'Wizard Form' and am trying to create control (Text boxes, radio buttons etc) on one of the tabs using commands.

Example:
$lstBoxMandatory = New-Object System.Windows.Forms.CheckedListBox

Reason: I am trying to make GUI XML driven i.e., based on a scenario the code will refer to specifics tags in an XML and create controls on a TAB 2 (for example)

Question:
How can I refer Tab2 for creation of these controls i.e., how can I direct a command like $lstBoxMandatory = New-Object System.Windows.Forms.CheckedListBox and make it specific to only Tab 2
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Referring a Tab in Wizard Template for control creation

Post by jvierra »

Just add it to the tab.

$tab2.Controls.Add($lstBoxMandatory)
This topic is 8 years 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