Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

TreeView issue

$
0
0

Hi,

I use WindowsForms to create one shell application. I use TreeView object to list some information. So far so good. I am adding nodes to the TreeView object with separator "/". 

$TreeView = New-Object System.Windows.Forms.TreeView
$TreeView.PathSeparator = "/"
$TreeView.Location = New-Object System.Drawing.Size(5,110)
$TreeView.Size = New-Object System.Drawing.Size(540,200)
$MainPage.Controls.Add($TreeView)


Next i start adding the nodes. The information added is generated from database. I assign the information to variables and then add it to the node:

$info = $global:objApp.Info
Add-Node $TreeViewTempl.Nodes "Main Node/Sub-Node: $info"

The problem is that in some cases the string in $info contains "/" forward slash character which is mistaken by the code for separator and the information is split into nodes instead shown in one node. 

Is there a way to "escape" this somehow?


Viewing all articles
Browse latest Browse all 21975

Trending Articles