Board index » delphi » Q: Text appearance changes with dif. background colors

Q: Text appearance changes with dif. background colors

Delvers,

The text in an Editbox and with TextOut()  displays differently
depending on the background colour selected. What irks me that the
same colour combination works fine for labels.

It's simple to demonstrate the probelm and it'll take less than a 30
seconds of your time.

1. Create a default form with one label and two edit boxes:

2. Change the background colour of the label and one edit box to the
light tint of red. (Top,Left swatch in the default w95 colour picker).

3. Change the background colour of the other edit box to bright red
(Immed. below the light red swatch in the colour picker).

Result:
Background of Label text - light red.
Background of bright red edit box text  - bright red.
Background of light red edit box text - gray.  :o(

Why the difference in appearance between the label and the edit box?
More importantly, can I avoid this when using TextOut()?

If not, what - use the api? I'm using TextOut to position of the text
based on length, height, font size, etc. and it works very nicely but
for this little quirk.

Rgds

Joe
j...@aztec.co.za

 

Re:Q: Text appearance changes with dif. background colors


... ignorant waffle deleted

Quote
>Why the difference in appearance between the label and the edit box?
>More importantly, can I avoid this when using TextOut()?

call SetBkMode(<DCHandle>,Transparent)  immediately before TextOut().

Other Threads