0

My custom Table control draws its own checkboxes and handles its own checkbox events. Right now when I compute the size of a themed checkbox (with GetThemePartSize()) I make sure all states are the same size, panicking if one is different. Checking all the states each time isn't reasonable if I'm going to change to computing checkbox sizes on the fly (passing in an HDC), and this does seem like a time when I can act more robustly than panicking (especially since I'm restructuring all my control's code anyway).

Can I assume that all themed checkbox states have the same size? And if not, how do I handle the size differences for the purposes of drawing: do I always use the largest size, and if so where do I draw smaller checkboxes relative to the largest size, or do I do something else? And for hit-testing: do I always consider the largest size?

The old "Windows XP Visual Guidelines" document suggests that they all should be the same size, but that doesn't guarantee anything for future versions of Windows (nor am I aware of similar documents for future versions of Windows). I see nothing else on MSDN or in the header files.

I'm specifically talking about uxtheme here; I don't know about nonthemed checkboxes (right now I just use the small icon size for all states, but I'm sure there's a better way to get the size that I don't know about...).

Thanks.

andlabs
  • 11,290
  • 1
  • 31
  • 52
  • You're out of luck if you want cast-iron guarantees about the way the visual style system works, since it is incredibly badly documented. It would be pretty weird if the checkbox state images **weren't** the same size however. I definitely wouldn't panic about it. – Jonathan Potter Mar 04 '15 at 00:30
  • Of course, which is why I'm asking what the most reasonable course of action should be. In fact, I should probably just list out the different approaches I can think of... ("just use the normal state's size and let states that grow break" is another one I just did) – andlabs Mar 04 '15 at 00:36

0 Answers0