Results 1 to 3 of 3

Thread: Graying a check box in a list box (One for the Guru's)

  1. #1

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185

    Question Graying a check box in a list box (One for the Guru's)

    I'm writing an application which has a listbox full of items. The Style property in the ListBox is set to 1 - CheckBox.

    I've written some sub classing code to stop the user unchecking the first item in the list box, but I also want to gray the check box of the first item so it looks disabled.

    How do I gray a check box in a list box?


    Thanks in advance
    Last edited by VB6Coder; May 15th, 2002 at 05:53 AM.

  2. #2
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    uk
    Posts
    327
    If you're subclassing it already then its a doddle. Simply intercept the paint message (I can't remember what it is offhand) and replace the paint routine with your own. You could even draw the whole listbox yourself

  3. #3

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185
    Have you got any example code on how I should draw a disabled check box?

    Cheers

Posting Permissions

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



Click Here to Expand Forum to Full Width