Alex & Access

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
My Photo
Name:Alex Dybenko

Location:Moscow, Russia
Google
 
Web AccessBlog.net

Wednesday, May 02, 2007

How to lock checkbox on Treeview

When you have a Treeview ActiveX control with checkboxes it could be required to prevent checking or un-checking certain nodes. Unfortunately you can not do this in NodeCheck event, but MouseUp event could help here.

Declare a form class level variable:

Private cNode as Node

In NodeCheck set it to a node you want to lock (in this sample – bold node):

If Node.Bold=True Then
     Set cNode = Node
End If

And reset it to original state in MouseUp event:

If Not cNode Is Nothing Then
     cNode.Checked = true
    Set cNode = Nothing
End If

Technorati tags: , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home