Search found 13391 matches

by jvierra
Wed Apr 24, 2019 6:14 am
Forum: Windows PowerShell
Topic: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
Replies: 4
Views: 54

Re: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?

Fix what? There is no way for us to know what your system issue is. The errors are clear. You need permission on the file which you don't have. What does that have to do with a country?
by jvierra
Wed Apr 24, 2019 5:21 am
Forum: Windows PowerShell
Topic: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
Replies: 4
Views: 54

Re: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?

"Cannot set execution policy. Execution policies at the MachinePolicy or UserPolicy scopes must be set through Group Policy." This is a pretty obvious message. To set the global policy you must be an admin running elevated. Set-ExecutionPolicy RemoteSigned[\b] "- Unable to load "d:\ps\userscript.ps1...
by jvierra
Fri Apr 19, 2019 3:48 am
Forum: PowerShell GUIs
Topic: Returning ChildForm values in MainForm variable!
Replies: 4
Views: 117

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

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

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

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

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

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

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

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']