- $completed = {
- Param($job)
- $listbox1.Items.Remove($job.Name)
- }
- $myjobname = 'somejob'
- Add-JobTracker -Name $myjobname ... -CompletedScript $completed
Remove text from richtexbox (to use status of jobs)?
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.
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.
Re: Remove text from richtexbox (to use status of jobs)?
A simple way to do this is:
Re: Remove text from richtexbox (to use status of jobs)?
Thanks but never used a datasource for a listbox. Is there an example you could share?
Re: Remove text from richtexbox (to use status of jobs)?
To answer your basic question- if it helps - consider the following:
- #
- $listview1.Items.Add('one','one',0)
- $listview1.Items.Add('two', 'two', 0)
- $listview1.Items.Add('three', 'three', 0)
- $idx= $listview1.Items.IndexOfKey('two')
- $listview1.Items.RemoveAt($idx)
Re: Remove text from richtexbox (to use status of jobs)?
I will also note that a richtest has a "Lines" property but it can only be editedd by a complete replacement ot "Lines"
$richtext.Lines = $richtext.Lines | ?{$_ -notmatch 'value'}
$richtext.Lines = $richtext.Lines | ?{$_ -notmatch 'value'}
Re: Remove text from richtexbox (to use status of jobs)?
Would you mind explaining what your code is doing?
Why do you add three items and why is the idx needed?
Why do you add three items and why is the idx needed?