Search found 13389 matches

by jvierra
Fri Apr 19, 2019 3:48 am
Forum: PowerShell GUIs
Topic: Returning ChildForm values in MainForm variable!
Replies: 4
Views: 84

Re: Returning ChildForm values in MainForm variable!

Yes - I know that but that was not your original question. The variables defined in the child form are available in the calling form as defined but it you assign them to a new variable in an event then the new variable will not be available outside of the event. Just use the child defined variables....
by jvierra
Thu Apr 18, 2019 2:58 pm
Forum: Windows PowerShell
Topic: DataGridView button column
Replies: 6
Views: 108

Re: DataGridView button column

So...just use Get-Process to see if the program is running.
by jvierra
Thu Apr 18, 2019 2:36 pm
Forum: Windows PowerShell
Topic: DataGridView button column
Replies: 6
Views: 108

Re: DataGridView button column

Something like that. What is it that tells you the button is disabled? Just evaluate that condition in the click event. No need to create any arrays.
by jvierra
Thu Apr 18, 2019 1:07 pm
Forum: Windows PowerShell
Topic: DataGridView button column
Replies: 6
Views: 108

Re: DataGridView button column

The important thing to note is that the "CellButton" has no events and is not a true button. It has no "enabled" or "visible" properties. It exisits as a pure slave of the grid control and just displays text. The grid handles the CellClick event. You can, possibly, use the cell click to ignore the c...
by jvierra
Thu Apr 18, 2019 12:55 pm
Forum: Windows PowerShell
Topic: DataGridView button column
Replies: 6
Views: 108

Re: DataGridView button column

You will have to manage the buttons programmatically but, unfortunately, this cannot be done with PowerShell. You will have to write C# code to alter the buttons behavior as the control in the cell is not exposed to the PS environment.
by jvierra
Thu Apr 18, 2019 7:04 am
Forum: PowerShell GUIs
Topic: How to select focus into current tab of TabControl
Replies: 4
Views: 74

Re: How to select focus into current tab of TabControl

To refresh any control use the control "Refresh()" method.

$tabpage1.Refresh()
$tabcontrol1.Refresh()
$textbox1.Refresh()


You can capture the F5 key in the form or any control in the keypress event. What it does is custom in the code. There is no need to use "SendKeys".
by jvierra
Thu Apr 18, 2019 7:01 am
Forum: PowerShell GUIs
Topic: How to select focus into current tab of TabControl
Replies: 4
Views: 74

Re: How to select focus into current tab of TabControl

Every page has a name. The name is not the text shown but is the "Name" property. There is no such thing as tab number. The "TabPages" property of the control is an array. There is a "TabIndex". If you click on a tab the index will be the tab page you clicked on. There is no need t do this as the cl...
by jvierra
Thu Apr 18, 2019 5:11 am
Forum: PowerShell GUIs
Topic: How to select focus into current tab of TabControl
Replies: 4
Views: 74

Re: How to select focus into current tab of TabControl

You can set the currently displayed tab by selecting the tab. You are selecting the tab control. There is no "clicking" when selecting a tab.

$tabcontrol1.SelectedTab = $tabcontrol1.TabPages['tabPage3']
by jvierra
Tue Apr 16, 2019 9:04 pm
Forum: PowerShell GUIs
Topic: Returning ChildForm values in MainForm variable!
Replies: 4
Views: 84

Re: Returning ChildForm values in MainForm variable!

Setting a variable in an event only defines the variable in the event. YOU cannot retain the value. It works the same for a function. Variables defined in a function or set in a function do not exists after the function ends. This is tru or all PowerShell scripts. To understand this read the followi...
by jvierra
Fri Apr 12, 2019 11:39 am
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 500

Re: Using Start-Job with credentials

This is what should work: $sb = { $splat = @{ ConfigurationName = 'Microsoft.Exchange' ConnectionUri = 'http://ServerName.doamin.com/PowerShell/' } $s = New-PSSession @splat Import-PSSession $s -AllowClobber (Get-MailboxDatabase | Where-Object { $_.MasterServerOrAvailabilityGroup -eq "DAG1" }).count...