Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    L.A., California
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TreeView Gray CheckBox (Access 2k)

    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,

  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TreeView Gray CheckBox (Access 2k)

    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.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    L.A., California
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TreeView Gray CheckBox (Access 2k)

    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.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: TreeView Gray CheckBox (Access 2k)

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

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    L.A., California
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TreeView Gray CheckBox (Access 2k)

    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.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TreeView Gray CheckBox (Access 2k)

    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, but it is for VB6. It would take work to adapt it for use in Access, and I'm not going to do that...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •