Search found 14984 matches

by jvierra
Tue Nov 30, 2021 11:26 pm
Forum: PowerShell GUIs
Topic: Button Yes No
Topic: Button Yes No
Replies: 5
Views: 225

Re: Button Yes No

You have to follow all of the instructions in my reply. The code is not the problem. First learn basic PowerShell then spend some time learning WinForms. Guessing will just waste your time. The button is likely set to return a dialog result. Remeber we can't see your sreen or yuour code and we canno...
by jvierra
Tue Nov 30, 2021 9:48 pm
Forum: PowerShell GUIs
Topic: Button Yes No
Topic: Button Yes No
Replies: 5
Views: 225

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
Topic: Button Yes No
Replies: 5
Views: 225

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: 1185

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: 318

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: 193

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: 1185

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: 3
Views: 307

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: 346

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: 549

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...