Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb.net Disable Treenode selection in Treeview

Posted on 2006-10-30
1
Medium Priority
?
2,726 Views
Last Modified: 2012-06-27
I want to be able to select a treenode and during the treeview after select event I want to disable the user from selecting (highlighting) other treenodes.  I want to disable the user from selecting other treenodes because I am loading a tiff file during the after select event.  How can This be done?  I have tried adding and removing the event handlers for after and before selection, but other treenodes become highlighted while I am loading my tiff file.
0
Comment
Question by:OFGemini
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 1000 total points
ID: 17835780
The TreeView.BeforeSelect event gives you the option to cancel selection, you just have to know when to do it.

If you create the event handler like this you should be ok:

Private Sub TreeView1_BeforeSelect(sender as Object, e as TreeViewCancelEventArgs) _
     Handles TreeView1.BeforeSelect

     If (loading) Then e.Cancel = True
End Sub

Private Sub LoadingTiff()
     loading = True
     ' Do whatever you have to do to load the tiff
     loading = False
End Sub

Protected loading As Boolean = False
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Six Sigma Control Plans
Progress

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question