View Full Version : How do I Change Tab Control Forecolour if it contains information


ptaylor-west
09-21-2001, 05:10 AM
How do I write an event procedure to change the colour of the title text of the tab control if the control contains some text,ie: Is Not Null so that it would indicate to operators that they need to click on the tab as it contains information

Rich@ITTC
09-21-2001, 05:54 AM
Hi Paul

I don't think you can change the caption background colour or the text/foreground colour on a tab control ... in fact it is the Page of the tab control that has a caption. Tabs tend to have a very bland generic colour ... pity!

However, you could change the caption ... from "Click Me!" to "Empty" or whatever depending on whether certain fields displayed on that page of your tab control contained data or not.

Something along the lines of:

If IsNull(Me!txtAddress) Then
Me!pagAddress.Caption = "No Address"

Else
Me!pagAddress.Caption = "Click here for Address"

End If

This would be within the coding for OnCurrent for the form.

HTH

Rich Gorvin

ptaylor-west
09-21-2001, 08:07 AM
Thanks Rich,

I haven't had chance to apply it yet but I will do so over the weekend and your solution is better than the colour idea anyway especially as I hadn't taken into account someone might have colour blindness

Paul

ptaylor-west
09-22-2001, 12:49 AM
Thnaks Rich,

It worked perfectly.

Paul