Delphi: Transparent controls become opaque in the netbook

For some reason, the transparent controls on the form became opaque on some computers. I got reports on “Acer Netbook” and “Thinkpad x600”. The application It was built using Delphi 2007.

This is what it looks like:
link

Although it looks like this:
link

The opaque controls on the form are TLabels and TStaticTexts.

(I use the TStaticText control to define the clickable area, because the mouse message cannot handle the control (such as the label) to the WM_NCHITTEST handler. The “button” at the bottom Is black because I accidentally set its color to clNone, although it shouldn’t be completely visible.)

Why does this happen and how to prevent it (except for rendering the text to the background image Other workarounds)?

Edit: I managed to reproduce the problem on my laptop, which runs Windows XP with 32-bit color and uses certified ATI drivers.

< div class="content-split">

Is there a TImage between the TLabel and the form? If this is the case, set the color of the form to black. When you set the TLabel to transparent, it draws it on its parent, and TImage cannot have child controls. In fact, it renders the color of the form On the label, because the form is the parent form.

The other two possible solutions include painting the image directly on the form (not using TLabel), but I don’t know if this works. One way is to create your own image control, it comes from TWinControl (not TGraphicControl) and can contain child controls. YMMV as far as these solutions are concerned.

I suspect it will not work on some machines The reason is that the underlying Windows API library is different.

For some reason, the transparent controls on the form become opaque on some computers. I am in ” It was reported on Acer Netbook” and “Thinkpad x600”. The application was built using Delphi 2007.

This is what it looks like:
link

Although it looks like this:
link

The opaque controls on the form are TLabels and TStaticTexts.

(I use the TStaticText control to define the clickable area, because mouse messages cannot be processed Controls (such as labels) go to the WM_NCHITTEST handler. The “button” at the bottom is black because I accidentally set its color to clNone, although it shouldn’t be completely visible.)

Why does this happen? This situation and how to prevent it (a workaround other than rendering the text to the background image)?

Edit: I managed to reproduce the problem on my laptop, which runs Windows XP with 32-bit color and uses certified ATI drivers.

< p>

Is there a TImage between the TLabel and the form? If this is the case, set the color of the form to black. When you set the TLabel to transparent, it draws it on its parent, and TImage cannot have child controls. In fact, it renders the color of the form On the label, because the form is the parent form.

The other two possible solutions include painting the image directly on the form (not using TLabel), but I don’t know if this works. One way is to create your own image control, it comes from TWinControl (not TGraphicControl) and can contain child controls. YMMV as far as these solutions are concerned.

I suspect it will not work on some machines The reason is that the underlying Windows API library is different.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3173 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.