Search found 11150 matches

by jvierra
Thu Aug 17, 2017 10:42 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 277

Re: GUI Has stopped Working [Powershell Studio]

The following construct would be much more efficient. $timer1_Tick = { $timer.Stop() try { if ($line = $script:Job.ChildJobs[0].Verbose.ReadAll()) { $RTB_Output.Lines += $line } if ($line = $script:Job.ChildJobs[0].Output.ReadAll()) { $RTB_Output.Lines += $line } if ($line = $script:Job.ChildJobs[0]...
by jvierra
Thu Aug 17, 2017 10:34 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 277

Re: GUI Has stopped Working [Powershell Studio]

The following method is more efficient.

Code: Select all

#Append output streams to $RTB_Output w/ new line 
$RTB_Output.Lines += $debugStream
$RTB_Output.Lines += $verboseStream
$RTB_Output.Lines += $outputStream
$RTB_Output.Lines += $errorStream
$RTB_Output.Lines += $warningStream
by jvierra
Thu Aug 17, 2017 10:30 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 277

Re: GUI Has stopped Working [Powershell Studio]

No. Stopping the timer should do it. 1000 ms should not give you this issue but it is BP to kill the timer except when you want high resolution ticks. Stopping and starting skews the tick interval slightly.
by jvierra
Thu Aug 17, 2017 9:44 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 277

Re: GUI Has stopped Working [Powershell Studio]

Stop the timer when entering the code and restart it when leaving. The exception looks like you are ticking in the Catch{} which can cause a race condition and repeated nested exceptions.
by jvierra
Thu Aug 17, 2017 7:46 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 175

Re: access group box from another form

Here is an example of how to send to a child:
by jvierra
Thu Aug 17, 2017 7:41 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 175

Re: access group box from another form

The sample is just two blank forms. It does not tell us what you are trying to do. hen a form calls a form the "calling" form is frozen until the "called" form is closed. THis is because the child is opened as a modal dialog. This is how PowerShell works. You cannot execute code in the parent form w...
by jvierra
Thu Aug 17, 2017 6:53 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 175

Re: access group box from another form

No idea how you are doing this. The main form cannot execute code while child form is running. You will need to post a simple example of your form.
by jvierra
Thu Aug 17, 2017 4:26 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 175

Re: access group box from another form

Hi woody - it is not possible to understand what you are trying to do. Please provide a more complete explanation. Note that yu cannot type or access a form while it has a child form showing.
by jvierra
Wed Aug 16, 2017 3:16 pm
Forum: PowerShell GUIs
Topic: Combo Box SelectedIndex Changes Automatically
Replies: 17
Views: 190

Re: Combo Box SelectedIndex Changes Automatically

I could have made 20 guesses before guessing t that. That also tells me that your code is changing something on the combo else the autocomplete would not do that. I suspect you will find other issues down the road. Go slow and look hard. Most things are discoverable in the debugger or with some brai...
by jvierra
Wed Aug 16, 2017 2:29 pm
Forum: PowerShell GUIs
Topic: Combo Box SelectedIndex Changes Automatically
Replies: 17
Views: 190

Re: Combo Box SelectedIndex Changes Automatically

Start by placing a breakpoint at the beginning of every event and every function. Run the form to the place where the problem happens and watch every line of code until you see where the error is happening. It may also be caused by interleaved closures. This is the hardest coding error to find. By c...