Search found 13 matches

by ivan.liao@live.com
Wed Mar 25, 2020 10:42 pm
Forum: PowerShell GUIs
Topic: How to prevent child form closing after click on a button in child form.
Replies: 8
Views: 197

Re: How to prevent child form closing after click on a button in child form.

jvierra wrote:
Wed Mar 25, 2020 10:39 pm
If a button has a dialog result set then it will close the form. Be sure that you have not set a "DialogResult" on any buttons that you don't want to close a form.
Thanks for your remind!
Now it does really help me to solve the problem.

Thanks again!
by ivan.liao@live.com
Wed Mar 25, 2020 10:40 pm
Forum: PowerShell GUIs
Topic: How to prevent child form closing after click on a button in child form.
Replies: 8
Views: 197

Re: How to prevent child form closing after click on a button in child form.

You cannot both close a child form and keep it open. When you close the form it closes and control is returned to the parent form. There is no other option. Seems I found a better solution here. # set difference value for DialogResult $btnSettingOK_Click={ Set-Settings $frmSettings.DialogResult = '...
by ivan.liao@live.com
Wed Mar 25, 2020 10:32 pm
Forum: PowerShell GUIs
Topic: How to prevent child form closing after click on a button in child form.
Replies: 8
Views: 197

Re: How to prevent child form closing after click on a button in child form.

You cannot both close a child form and keep it open. When you close the form it closes and control is returned to the parent form. There is no other option. I'm not close the child form in my code. I have 3 buttons in this child form, just don't know why all these button will close the form even th...
by ivan.liao@live.com
Wed Mar 25, 2020 10:10 pm
Forum: PowerShell GUIs
Topic: How to prevent child form closing after click on a button in child form.
Replies: 8
Views: 197

Re: How to prevent child form closing after click on a button in child form.

You cannot return a value like that from a child form. Use the global variables created by child forms. See: https://info.sapien.com/index.php/guis/gui-scripting/powershell-studio-passing-and-returning-values-using-forms Thanks for your reply. But what I'm care about is not the return value. I just...
by ivan.liao@live.com
Wed Mar 25, 2020 7:52 pm
Forum: PowerShell GUIs
Topic: How to prevent child form closing after click on a button in child form.
Replies: 8
Views: 197

How to prevent child form closing after click on a button in child form.

Hi everyone here, I just created a multi-form project. A child form used for load settings and change program running settings. There are 3 buttons in this child form. Which are 'Reset default', 'OK', and 'Cancel'. Both 3 buttons are corresponding to call a function to do something. But don't know w...
by ivan.liao@live.com
Tue Feb 25, 2020 10:00 pm
Forum: PowerShell GUIs
Topic: Sometimes control responds event twice.
Replies: 4
Views: 1147

Re: Sometimes control responds event twice.

This can only happen if you have an error in your code. I cannot see your code so there is no way to help you with this. Each control I added only one in designer, but don't know why it added twice after deployed. I use cygwin grep to find out which control have been added twice after deployed here...
by ivan.liao@live.com
Tue Feb 25, 2020 9:52 pm
Forum: PowerShell GUIs
Topic: Sometimes control responds event twice.
Replies: 4
Views: 1147

Re: Sometimes control responds event twice.

There is no reason for this. PowerShell Studio does not support WPF so you must have had coded it. I suspect you are adding the click event twice in your code. Thanks for you reply! I added only one button and one click event in my code. But don't know why it will have twice after deployed. I can f...
by ivan.liao@live.com
Tue Feb 25, 2020 9:32 pm
Forum: PowerShell GUIs
Topic: Sometimes control responds event twice.
Replies: 4
Views: 1147

Sometimes control responds event twice.

Good day, everyone here. I use PowerShell Studio 2019 5.6.160.0 to create a WPF project. I found sometimes a control will responds event twice. For example, I have a button. Added click event for it. Event to show a message, when I run and click on this button. Don't know why message shown twice. I ...
by ivan.liao@live.com
Sat Jan 18, 2020 11:49 pm
Forum: Windows PowerShell
Topic: How to let PowerShell x86 return an object while call powershell x86 cmdlet from powershell x64
Replies: 1
Views: 1560

How to let PowerShell x86 return an object while call powershell x86 cmdlet from powershell x64

Hi everyone here, I'm currently developing a tools with PowerShell. I would like to let this tools run in PowerShell x64. But some of my action need to call a CmdLet in a DLL, but this dll does not has x64 version. I have to use PowerShell x86 to get this done and get the result. Something like this...
by ivan.liao@live.com
Sat Jan 18, 2020 11:47 pm
Forum: PowerShell GUIs
Topic: Can I move GroupBox from a tab to another tab in TabControl?
Replies: 3
Views: 453

Re: Can I move GroupBox from a tab to another tab in TabControl?

You can copy it from the controls collection on one tab to the controls collection on another tab using the "CopyTo" method of the collection. Thanks for your reply! But I'm not meaning move GroupBox while design UI via PowerShell Studio. I'm trying to move it by code while script is running. Just ...