Search found 33 matches

by mar10c
Wed Sep 17, 2014 6:59 am
Forum: PowerShell GUIs
Topic: Checkboxlist selected items
Replies: 8
Views: 5549

Re: Checkboxlist selected items

the switch statement executes the moon only. I was looking to:
1. find all the checked ones in the checkboxlist
2. find the values of the checked ones then execute based on what the value is.

Thanks for your help.
by mar10c
Tue Sep 16, 2014 5:56 am
Forum: PowerShell GUIs
Topic: Checkboxlist selected items
Replies: 8
Views: 5549

Re: Checkboxlist selected items

Sorry I me meant to do something like this. What should the $items. be?

foreach ($items in $checkedlistbox1.SelectedItems)
{
if($items.('earth'))
{
Invoke-StoredProc1
}

elseif($items.('earth'))
{
Invoke-StoredProc2
}

}
by mar10c
Mon Sep 15, 2014 2:09 pm
Forum: PowerShell GUIs
Topic: Checkboxlist selected items
Replies: 8
Views: 5549

Checkboxlist selected items

I can't seem to get this to work?

if($CheckBoxList1.SelectedItem -eq "earth"){
..run code here
}
elseif($CheckBoxList1.SelectedItem -eq "wind"){
..run code here
}
elseif($CheckBoxList1.SelectedItem -eq "fire"){
..run code here
}


Am i missing something?