Surendra Sharma

Surendra Sharma

Search This Blog

Tuesday, July 23, 2013

'Selected' is not a member of 'System.Windows.Forms.TreeNode'.

During migration from VB to VB.NET if you are getting error as "'Selected' is not a member of 'System.Windows.Forms.TreeNode'." with following type of code
  
'UPGRADE_ISSUE:Node property myTreeView.Nodes.Selected was not upgraded.
myTreeView.Nodes.Item("Item1").Selected = True

Solution: -

Use “SelectedNode” property to show child node as selected as below


myTreeView.SelectedNode = myTreeView.Nodes.Item(("Item1")

No comments:

Post a Comment