Hello !
I'm working on a Powershell v2.0 computer but the script is meant to be executed with powershell 5.0
Both script and Operating system are 64 Bits
I am pretty new to powershell and work on a script that permit users from my company to test servers remotely.
I've been trying for a few days to add the "Start, pause, restart" functions to this ListView, either by context menu or by Buttons.
What i'm struggling with so far is to detect the "click event" in my listview.
$Global:listS = New-Object System.Windows.Forms.ListView
$listS.Location = "5,35"
$listS.Size = "800, 600"
$listS.View = "Details"
$listS.GridLines = $true
$listS.FullRowSelect = $true
$listS.AllowColumnReorder = $true
$listS.Scrollable = $true
$listS.Sorting ='None'
$listS.add_ColumnClick({SortListServices $_.Column})
$PopupServices.Controls.Add($listS)
That's my working listview code right now.
When i click on a line of the listview, it becomes blue highlighted but "$listS.ItemSelected" is always set to the first row of the listview.
edit : $list.SelectedItem
Do you guys have an idea ?
Context menu on listview
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Context menu on listview
Yeah, looks like i messed up writing this down...
Problem is still the same sadly
Problem is still the same sadly
Re: Context menu on listview
It is not really possible to understand what you are asking. How are you trying to do this. What does a context menu have to do with this. I see no context menu.
Post a simplified PSF file example that shows how your are trying to do this.
Post a simplified PSF file example that shows how your are trying to do this.