i've made a wimdowsform with checkboxes in powershell.
i use switch command to make check/uncheck. it works like i want. If we check a checkbox i add a variable but it's still empty.
...
$checkbox_un.Add_CheckStateChanged(
{
switch ($checkbox_un.Checked) {
$false { $checkbox_deux.enabled=$true; $checkbox_deux.Checked=$False; break }
$true { $checkbox_deux.Enabled=$False; $checkbox_deux.Checked=$False; $fs="FAT32"; break }
}
})
$checkbox_deux.Add_CheckStateChanged(
{
switch ($checkbox_deux.Checked) {
$false { $checkbox_un.Enabled=$true; $checkbox_un.Checked=$False; break }
$true { $checkbox_un.Enabled=$false; $checkbox_un.Checked=$false; $fs="NTFS"; break }
}
})
...
$fs returns always empty , i don't understand why ?
Aucun commentaire:
Enregistrer un commentaire