Click to See Complete Forum and Search --> : Form refuses to display text in red ....


ThermoSight
November 15th, 2005, 09:53 PM
Certainly this is an instance of the the lowest possible priority of question but I am kinda curious...

I have a form which has two text boxes, one for an IP address, one for a port number (yes, I should combine'em but I haven't ... yet). Above one and beneath the other are normally-invisible labels bearing helpful text. The 'properties' window clearly shows that the 'forecolor' is red.

It was my intention that when the program detected an invalid IP address or Port number, that the appropriate label would display its text (range of valid port nos., or IP address example) in red text to catch the user's eye.

Well, it USETA work, but today I discovered that when the program detects an error, the label is made visible but the text is black even though the 'properties' window clearly shows the 'forecolor' property to be red. Oh! and inspection of the normally-hidden "InitializeComponent" code in the .h file confirms my request for red text.

Any idea what I'm doing wrong that would cause the form to ignore my request for red text?

thanks,

bill

cilu
November 16th, 2005, 10:51 AM
Must be a form with a mind of its own. ;)

Obviously, I don't believe that a particular color has to do something with it (probably magenta works just as red or any other color).

Are your labels disabled and enabled when an error occurs, or are they invisible (but enabled) and shown when an error occurs?

ThermoSight
November 16th, 2005, 12:28 PM
That was it, Cilu ! You were right .....

Somewhere along the line I had DISabled the labels, completely unaware of the effect that would have on the label display.

And, while I haven't tried it, I am certain that you are also correct that any color would have failed .... the error was completely unrelated to the color red, specifically. I shouldn't have been so specific in describing the problem.

So ... thanks so much for your help, Cilu. I learned something that'll stay with me forever, and will certainly come in handy again.

Best wishes,

bill

cilu
November 17th, 2005, 06:18 AM
All right. You're welcomed.