Am I mis-remembering? I thought that one could change the TextColor of a groupbox caption?
Was this an attribute that we could change in the past, but no longer?
AFAIK it never has been possible.
A long while ago I had some weird issues with the Groupbox control having the caption been used.
For inexplicable reason these were solved when setting the caption to āā
Since that day I use a label control on top of it instead. If you start and end with a space it looks like a groupbox-caption and you can also set the color of it.
I thought about the label idea⦠but I have dozens of windows some with 2 or 3 groupboxes. and dread redoing themā¦
I didnāt realize that the caption didnāt āgray outā if you disabled the control
[quote=333521:@Dave S]
I didnāt realize that the caption didnāt āgray outā if you disabled the control :([/quote]
Labels donāt either⦠but they used to⦠Apple has stopped caring about having constant visual clues apparentlyā¦
- Karen (who changes labels to disabled text color in one when needed even it not the current UI)
Yeah⦠my original code just disabled the groupbox
then I realized that the labels INSIDE didnāt changeā¦
so I created a method to address each label (in a control set) to change its color
that is when I noticed the groupbox itself didnāt change either
but at least you CAN change a Label⦠you CANāT change a Groupbox
I donāt recall a time Iāve seen a label disabled in software I use.
Controls get disabled, but I donāt see a need to disable a label. Theyāre still useful to let the user know what theyāre labeling, even if the item they are labeling is disabled.
I donāt have a data-backed argument for my opinion, so I stayed quiet on this one.
my rationale is this.
I have two groupboxes each containing various controls⦠labels, textfields, listbox etc.
I do not want the bottom groupbox to be āactiveā until the user has filled in a minimal amount of data in the top groupbox
until that time, I want ALL the contents to be āgrayā⦠having somethings āgrayā and others āblackā looks wrong.
[quote=333531:@Dave S]Yeah⦠my original code just disabled the groupbox
then I realized that the labels INSIDE didnāt changeā¦[/quote]
What about creating nice containercontrols. Enable and disabling is quite straight forward, including everything which is in it.
first off⦠a groupbox is a ācontainerā⦠.so disabling it does in fact ādisableā everything inside of itā¦
the issue is the visual aspects of a label (and a listbox for that matter) do not change just because the enable flag did
so I would have to loop thru all the controls, decide who owned them, and change the textcolor based on the flagā¦
which is exactly what I am doing now.
[code]Public Sub DoEnable(extends g as GroupBox, enable as Boolean)
Dim w As Window = g.TrueWindow
if w<>nil then
for i as Integer = 0 to w.ControlCount-1
Dim ctrl As RectControl = RectControl(w.Control( i))
if ctrl<>nil then
if ctrl.Parent = g then
ctrl.Enabled = enable // or whatever you want depending on the control class
End If
End If
Next
End If
End Sub
[/code]
Jean-Yves⦠that does not solve the problem
Why not create your own groupbox with a ContainerControl with styled label, enabled property and so on ? Then just make the super of your present out of the box groupboxes with your new control.