• TreeView Gray CheckBox (Access 2k)

    Author
    Topic
    #396838

    Hi All,

    I have a Treeview control on an Access form. I want to be able to make the checkbox of a particular node gray to indicate that some, but not all, of its child nodes are checked. I already have the logic in place to determine this. What I can’t do is find a method to grey the checkbox. I can only find a checked property.

    Is there any way to do what I want, maybe using a SendMessage or other API call?
    Thanks,

    Viewing 3 reply threads
    Author
    Replies
    • #746858

      One way you might be able to do this is to use images with your tree nodes instead of a checkbox- three sepearate images for checked, non checked and greyed out, with actions depending on the picture showing.

      • #746866

        Nice thought, but it won’t work for me, as I’m already using images in the TreeView to convey other types of information to the user. Besides that, I’m not sure there’s an “image click” event available, which I would need when “checking” or “unchecking” the TreeView nodes, if I didn’t have “real” checkboxes turned on.

        • #747020

          The VB6 TreeView control doesn’t support three-state check boxes. You would have to use the “real” treeview control (which the VB6 control is a wrapper of) and lots of API code. Brad Martinez has an example on the MVPS site: TVCheckBoxesEx example at http://www.mvps.org/btmtz/treeview%5B/url%5D, but it is for VB6. It would take work to adapt it for use in Access, and I’m not going to do that…

        • #747021

          The VB6 TreeView control doesn’t support three-state check boxes. You would have to use the “real” treeview control (which the VB6 control is a wrapper of) and lots of API code. Brad Martinez has an example on the MVPS site: TVCheckBoxesEx example at http://www.mvps.org/btmtz/treeview%5B/url%5D, but it is for VB6. It would take work to adapt it for use in Access, and I’m not going to do that…

      • #746867

        Nice thought, but it won’t work for me, as I’m already using images in the TreeView to convey other types of information to the user. Besides that, I’m not sure there’s an “image click” event available, which I would need when “checking” or “unchecking” the TreeView nodes, if I didn’t have “real” checkboxes turned on.

    • #746859

      One way you might be able to do this is to use images with your tree nodes instead of a checkbox- three sepearate images for checked, non checked and greyed out, with actions depending on the picture showing.

    • #747008

      Is there a reason you posted this question in VB/VBA instead of in Access?

      • #747018

        I thought of using the Access section but the TreeView control is, after all, a Microsoft common control which I would normally use in a VB project. Any answer I get here would be pertinent to either development environment.

      • #747019

        I thought of using the Access section but the TreeView control is, after all, a Microsoft common control which I would normally use in a VB project. Any answer I get here would be pertinent to either development environment.

    • #747009

      Is there a reason you posted this question in VB/VBA instead of in Access?

    Viewing 3 reply threads
    Reply To: TreeView Gray CheckBox (Access 2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: