BackColor on disabled TextBox (1 Viewer)

jjturner

Registered User.
Local time
Today, 14:30
Joined
Sep 1, 2002
Messages
386
Hello All - question on cosmetic appeal here:

I'm witnessing strange behavior on the setting of a textbox's BackColor/Style when Enabled = False.

On my Form-Details section background, I've specified a different color than the Windows default gray. Some TextBoxes are being used (rather obtusely, perhaps) as Labels that get conditionally 'grayed-out' based on the values in other controls. (I use TextBoxes because Labels don't have an 'Enabled' property and these pseudo-Labels are unable to be logically associated to 1 particular control, otherwise I'd just cut and paste a Label to that particular control to handle the 'enabling/disabling' bit.)

The BackStyle on these pseudo-Labels are set to Transparent by design. They're also set to Enabled: No and Locked: No by design.

The result is that the Windows default gray is displayed as the BackColor instead of the color I specified for the Form-Details background (the latter color being the expected color since I've set BackStyle to Transparent on the pseudo-Labels).

Am I overlooking something in terms of property settings to get these 'disabled' TextBoxes to remain Transparent (rather than displaying Windows gray BackColor) while in the disabled state?

Any advice or suggestions greatly appreciated.

Regards,
John
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 09:30
Joined
Dec 26, 2002
Messages
4,748
Do enabled = no
locked = yes

This should stop it from changing to the annoying Windows grey.

HTH,

Vassago
 

jjturner

Registered User.
Local time
Today, 14:30
Joined
Sep 1, 2002
Messages
386
Vassago,

Apologies for not giving full disclosure. :rolleyes:

Yes, that works, but switching the Locked property programmatically was already my method of 'activating' the pseudo-Labels (so the contained text would look 'active'). Essentially, I was hoping to maintain the Label transparency when Locked = No, but still showing 'disabled' or 'inactive' text.

(If you want to talk weird, I can get Transparency to work for some of the pseudo-Labels while Unlocked and Disabled - even though the property settings are the same as the troublesome ones!)

Thanks for your response and consideration.

Regards,
John
 

Users who are viewing this thread

Top Bottom