Blacked-Out Option Buttons

Filed under Uncategorized

Here’s an oldie but a goodie.

I hadn’t run into this in years, but here it was, making a nasty return.

Basically, if you’re running a VB6 application under Windows XP, and you have all the XP UI goodies turned on (the default), and your app contains option buttons directly sited within a Frame (pretty typical), the text of the option buttons will be blacked out by nasty black squares.

When I first ran into this, far too many years ago to mention, there was nothing about it anywhere. I remembered looking for several days for a solution before stumbling onto one.

Fortunately, there’s now a good KB article (KB936166) on the issue (though MS never fixed it).

Interestingly, as workarounds, the article offers:

Right-click the desktop, click Properties, click the Themes tab, and then select Windows Classic in the Theme list. Alternatively, click the Appearance tab in the Display Properties dialog box, and then click Windows Classic style in the Windows and buttons list.
Do not put option buttons inside frames.

While helpful, neither of these options would really do much to make my customers happy.

Fortunately, there is a third option:

Site your option buttons in a PictureBox (just set the background color appropriately and frame style to NONE) and then site the PictureBox on your frame.

Everyone’s a winner, and it’s not too terribly stomach-churn inducing.

3 Comments

  1. Ralf says:

    You know, in the DOS days we never had these problems! What? Oh… My nurse informs me I am on the wrong thread.

    But since we’re on the subject of fancy-pants themes, ANOTHER thing I loathe about the default XP theme (should have named it "toothpaste from a tube") is how it plays tricks with the width of Windows frames.

    On one of my apps, I’d carefully placed a row of buttons along the bottom of the form, and included code to keep them positioned should the form be resized. Excellent; looks great in development. Installed it on a plain vanilla XP machine for testing and OHGOD OHGOD OHGOD WHERE ARE MY FRIKKIN BUTTONS WHERE DID THEY GO?!

    The lower frame had totally "eaten" the buttons. Only the top two rows of pixels peeped up.

    That’s the day I learned about GetSystemMetrics and all the wonderful stuff you can ascertain about how Windows is (mis)configured.

    Oh, and if you want to make a newbie developer cry, run their app using "Large Fonts".

  2. Darin says:

    Hehe. Large fonts can make even big commercial apps collapse into a hideous pile of goo.
    I used to run Large Fonts all the time (till I got a monitor large enough that I don’t need to anymore<g>). I was generally considered the bane of every other developer’s existence because even minor lapses of ui coding would result in a garbaged screen for me.
    Of course, I also regularly used a simply god-awful color scheme that would highlight, immediately, where people hadn’t paid attention to specifying Windows Colors and had hardwired them instead.

    Fun stuff.

  3. I am getting this problem on Vista with a 6.0 app. I tried the picture box but get the same result; the whole frame is blacked out. I have a checkbox enabling/disabling the frame and option buttons.

    Any ideas?

    Thanks!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*