Any way to control format of combox when enabling/disabling?


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm trying to control the enabled/disabled state of a combobox, based on editing state. I know how/where to handle this (EditingStateChanged event), but when I disable my combo, it has a gray background. I tried to instead use the BindingEditable property, but it did the same thing. Yet, bound SF combos have a white background and light light gray text. What am I not doing/doing wrong?



Thanks!
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Are you using an SF combo box or a regular combo box?  We override the OnPaint() of the SF combo box to draw the different colored background because people hate the way you cannot read disabled text.  So, if you're using the SF combo box, it should be doing that when you use the Enabled property, but if you're using the regular combo box, then it won't have that functionality.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm using a SF combo. When it is bound it has light light gray text on a white background. But when it isn't bound, it is black text on a gray background.



On a side note, how do you control that enabled appearance? I haven't noticed any difference in its behavior.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I'm going to have to defer to Trent on this one... I'll have him check it and let you know.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If the control is not bound then we do not manage the enabled states.  When bound, however, we manage the state of a combo box differently than any other control.  The reason for this is that when a combo is a DropDown it renders differently in a disabled state then when a DropDownList.  Thus, when disabled, the control will always render as a DropDownList and we manage the state back and forth.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
This seems to support that it will be hard to get an unbound SF combo to look the same as a bound SF combo.



My solution was to add a custom bindable field to the BO that just translates the value of the field to the enum I want. I.e. I had a boolean field, but wanted to provide a drop down with yes/no in it. I just made a custom field that translated the boolean to the enum on get and from the enum to boolean on set. It works great.



Thanks for the clarification on how this works.



One last question: you've stated that you did work to render the disabled controls in a more readable state. Is that done? Do we have that? All my disabled controls are still light light gray on white when disabled.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, they are normally dark gray on light gray when disabled and they have been changed to gray on white (it actually is more readable...).  But there should be new properties on the controls for background/foreground disabled colors, so you should be able to changes those and get the effect you're looking for.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search