Wrox Programmer Forums
|
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2012, 04:17 PM
Authorized User
 
Join Date: Nov 2011
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Question Determining If A Node is Selected

Hi Rod,

Can you tell me how to write the code to automatically check if Any node in Tree View is selected? This is critical in my application because if a certain procedure is run and a node has not been selected, it will cause an exception. I look forward to your reply.

Gary
 
Old March 31st, 2012, 04:37 PM
Authorized User
 
Join Date: Nov 2011
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Wink Found the answer

Hi Rod,

I just found the answer to my question. All I have to do is to set the focus on the Tree View control when I add the first node to it. In that way it will automatically select that node. After that, there will always be one node selected and the problem will be solved. I used:

TreeView1.Focus()


Thanks for your ongoing help. I will certainly be back with more questions.


Regards,


Gary





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a node to an existing xml node list. codehelp C# 2008 aka C# 3.0 2 October 12th, 2009 07:41 AM
Displaying data as a Parent Node with Left Node and Right Node Manoj Bisht Visual Basic 2008 Professionals 0 April 2nd, 2009 02:34 AM
VB.net adding data in a selected node saikoboarder XML 9 May 16th, 2008 06:37 AM
Determining which of 2 nodes in this node chrscote XSLT 1 August 9th, 2005 11:45 AM
syntax error on <option selected="selected"> hamid HTML Code Clinic 1 October 13th, 2004 09:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.