Detect click on the +/- button in a TreeView / Conversion of C# to Powershell
<p>I have a powershell script with a winform and a treeview. </p>

<p>Now I need to distinguish if a user clicked on the <strong>name</strong> of a winforms <strong>treeview node</strong> or on the <strong>plus or minus</strong> in front of the node.</p>

<p>If found this code:</p>

<pre><code>private void treeView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
    var hitTest = treeView1.HitTest(e.Location);
    if (hitTest.Location == TreeViewHitTestLocations.PlusMinus)
    { 
        //expand collapse clicked
    }
}
</code></pre>

<p>in this <a href="https://stackoverflow.com/questions/19226171/detect-click-on-the-collapsebutton-in-a-treeview/19226398#19226398">answer</a>. I tried to translate it into Powershell (see below) and it seems to work... but: 
The problem is, wherever I click, the result is always "<strong>indent</strong>", which is one of the possible return values (<a href="https://msdn.microsoft.com/en-us/library/system.windows.forms.treeviewhittestlocations%28v=vs.110%29.aspx" rel="nofollow noreferrer">TreeViewHitTestLocations-Enumeration</a>)
But it should not be always the same, wherever I click.</p>

<pre><code>$hitlocation = $treeview1.HitTest($treeview1.Location)
Write-Debug "$($hitlocation.location)"

if ($hitlocation.Location -eq [System.Windows.Forms.TreeViewHitTestLocations]::PlusMinus){ 
   # do stuff
   write-host "yes!"
}
</code></pre>

<p>So the question is, did i translate the code wrong, or is there another problem?</p>