Search found 14983 matches

by jvierra
Tue Nov 30, 2021 9:48 pm
Forum: PowerShell GUIs
Topic: Button Yes No
Replies: 3
Views: 17

Re: Button Yes No

Because you are blindly copying things from teh Internet you are using code that is either unnecessary or code that won' work in WInForms. $buttonLater_Click={ switch ([System.Windows.MessageBox]::Show('Do you want to complete later?', 'Confirm', 'YesNo', 'Warning')){ 'Yes' { $dt = Get-Date -Format ...
by jvierra
Tue Nov 30, 2021 9:35 pm
Forum: PowerShell GUIs
Topic: Button Yes No
Replies: 3
Views: 17

Re: Button Yes No

Be sure the button properties do not define a DialogResult. By default, a button may be defined to terminate the form.
by jvierra
Tue Nov 30, 2021 2:52 pm
Forum: PowerShell GUIs
Topic: posh studio EXE gets an ODBC connection error
Replies: 13
Views: 1036

Re: posh studio EXE gets an ODBC connection error

See "help about scopes" It doesn't matter where you put it, the object has to be "in scope". and object declared in a module or function will dispapear from all scopes when the function exits. It is better to vae a function that returns a connection object or, better, a function that returns a Data...
by jvierra
Sun Nov 28, 2021 8:49 pm
Forum: PowerShell GUIs
Topic: $Treeview focus
Replies: 5
Views: 271

Re: $Treeview focus

Again, start with the docs. You can clear a set object by assigning the object reference to "$null"
by jvierra
Sun Nov 28, 2021 3:32 pm
Forum: PowerShell GUIs
Topic: Programatically add a new row to a databound datagridview.
Replies: 2
Views: 176

Re: Programatically add a new row to a databound datagridview.

Just add a new row to the DataTable object. See docs for DataTable and examples of how to add a row.
by jvierra
Fri Nov 26, 2021 10:45 pm
Forum: PowerShell GUIs
Topic: posh studio EXE gets an ODBC connection error
Replies: 13
Views: 1036

Re: posh studio EXE gets an ODBC connection error

I was pretty sure that was the issue as it is quite common. See "help about scopes" to understand how "scope" is implemented in PowerShell.

And Happy Thanksgiving to you too. Watch out for the cranberries...they can be a challenge.

Observe the following: https://www.youtube.com/watch?v=8MuhFxaT7zo
by jvierra
Fri Nov 26, 2021 11:57 am
Forum: PowerShell GUIs
Topic: Checkbox flatappearance.checkedbackcolor didn't work
Replies: 1
Views: 171

Re: Checkbox flatappearance.checkedbackcolor didn't work

You can't change the color after the checkbox has been displayed. Set the color in the properties of the control.
by jvierra
Fri Nov 26, 2021 11:52 am
Forum: PowerShell GUIs
Topic: Get value of cell based on another cell from datagridview
Replies: 2
Views: 286

Re: Get value of cell based on another cell from datagridview

Use the column name and not the index. The index is transient and the name always specifies the correct column.

$datagridviewResultsLogs.SelectedCells['Device'].Value
by jvierra
Wed Nov 24, 2021 5:22 pm
Forum: PowerShell
Topic: How to delete my .EXE script just before exit it?
Replies: 8
Views: 516

Re: How to delete my .EXE script just before exit it?

I have used TS in the past to divorce processes and have not always found it that reliable and you have to deal with credentials. But thats fine, the good thing with powershell and MS...you have loads of choices. Not true under the question was asked and, in both cases, you would require credential...
by jvierra
Tue Nov 23, 2021 10:05 pm
Forum: PowerShell
Topic: How to delete my .EXE script just before exit it?
Replies: 8
Views: 516

Re: How to delete my .EXE script just before exit it?

Sounds like too many operations when you can just schedule a one shot and exit the program. THat does everything you are doing in one line.

Why write ten times as much code as necessary?