Refresh Combobox function
Posted: Sat Dec 08, 2018 3:32 am
Hi am tryin to create a function to update combobox but stuck in how to define the combobox
Update-ComboBox $combobox (Get-ChildItem "$Path" -Directory) "Name
How to pass the param $combobox to Update-ComboBox Comboxbox
and keep the $
RefreshCombobox -Combobox combobox_Vendor -Path "C:\SD"
pass the value as "combobox_Vendor" and i need it as $combobox_Vendor
is this possible?
Code below
code sample for creating the folder for the form.
Update-ComboBox $combobox (Get-ChildItem "$Path" -Directory) "Name
How to pass the param $combobox to Update-ComboBox Comboxbox
and keep the $
RefreshCombobox -Combobox combobox_Vendor -Path "C:\SD"
pass the value as "combobox_Vendor" and i need it as $combobox_Vendor
is this possible?
Code below
Code: Select all
$CreateAppStructure_Load={
#TODO: Initialize Form Controls here
RefreshCombobox -Combobox combobox_Vendor -Path "C:\SD"
}
#region Control Helper Functions
#endregion
function RefreshCombobox ($combobox,$Path)
{
Update-ComboBox $combobox_Vendor (Get-ChildItem "$Path" -Directory) "Name"
}
code sample for creating the folder for the form.
Code: Select all
New-Item c:\SD -ItemType Directory
1..10 | foreach {
$i++
New-Item c:\SD\Folder$($i) -ItemType Directory
}