Search found 75 matches

by boyddt_co
Tue Jul 22, 2014 1:04 pm
Forum: PowerShell GUIs
Topic: deleting items from a listbox
Replies: 15
Views: 11843

Re: deleting items from a listbox

here is the code that does what I want. Thank you for your help.

$buttonClearSelectedSun_Click={

$selectedCount = $lb_sun.SelectedItems.Count
for($selectedCount;$selectedCount -ge 1; $selectedCount--)
{
$idx = $lb_sun.SelectedIndex
$lb_sun.Items.RemoveAt($idx)
}

}
by boyddt_co
Tue Jul 22, 2014 7:00 am
Forum: PowerShell GUIs
Topic: deleting items from a listbox
Replies: 15
Views: 11843

Re: deleting items from a listbox

one listbox with 6 items. highlight items 2, 4 & 6. click button and have items 2, 4 & 6 removed from the listbox. one click.
by boyddt_co
Mon Jul 21, 2014 2:52 pm
Forum: PowerShell GUIs
Topic: deleting items from a listbox
Replies: 15
Views: 11843

Re: deleting items from a listbox

OK, if you look at the form it is broken down into four areas; cell, machine, parts and the days of the week. A user would choose the cell then the machine. This will populate lb_parts with the possible part numbers that the machine can produce. The user would then highlight the parts that they want...
by boyddt_co
Mon Jul 21, 2014 1:04 pm
Forum: PowerShell GUIs
Topic: deleting items from a listbox
Replies: 15
Views: 11843

Re: deleting items from a listbox

So I tried two examples and neither is working how I want. Yours, as listed below, didn't do anything and I'm not sure when 'SelectedIndexChanged' fires. The next one worked but I had to click the button for each item selected. Workable but not exactly what I was hoping for. $lb_mon_SelectedIndexCha...
by boyddt_co
Mon Jul 21, 2014 10:59 am
Forum: PowerShell GUIs
Topic: deleting items from a listbox
Replies: 15
Views: 11843

Re: deleting items from a listbox

Thank you for you input. I found the command from a different page and had just finished testing when you responded. The reason I didn't just delete the items is that I didn't know what the command was. I tried one way but with multiple items selected it would delete the first one but then the index...
by boyddt_co
Mon Jul 21, 2014 8:53 am
Forum: PowerShell GUIs
Topic: deleting items from a listbox
Replies: 15
Views: 11843

deleting items from a listbox

I have a list box that I need to delete some (selected) items from. I know from an Outlook project that I need to count from the bottom of the index and work my way up so as not to break the index. I can get the count of items and but I'm struggling with the is selected part of the equation. Can som...
by boyddt_co
Thu Jul 17, 2014 8:59 am
Forum: PowerShell GUIs
Topic: Form Control Type
Replies: 2
Views: 1252

Re: Form Control Type

Thank you, that helped.
by boyddt_co
Wed Jul 16, 2014 9:26 am
Forum: PowerShell GUIs
Topic: Form Control Type
Replies: 2
Views: 1252

Form Control Type

I need to enumerate the controls on a form and disable some based on a users selection. I can do the enumeration and the disabling but what I'm struggling with is getting the type of control that I'm working with. Can someone provide the code that I would use to pull what type of control I'm accessi...
by boyddt_co
Tue Apr 15, 2014 11:22 pm
Forum: PowerShell GUIs
Topic: Changing font styles
Replies: 5
Views: 2792

Re: Changing font styles

You are the man, it worked like a champ!!!!

Thanx.
by boyddt_co
Tue Apr 15, 2014 11:14 pm
Forum: PowerShell GUIs
Topic: Changing font styles
Replies: 5
Views: 2792

Re: Changing font styles

It is for a label and I'll try your suggestion.

Thanx for the help