StrataFrame Forum

How do I make a label appear disabled?

http://forum.strataframe.net/Topic6428.aspx

By Greg McGuffey - 1/30/2007

I have a small button with no text and a label beside it. I need to make the label appear "disabled", so the user knows the button is disabled. I know SF does it with BO-form/control interactions, so maybe just a pointer as to where exactly to look would be great.



Thanks!
By Trent L. Taylor - 1/30/2007

Is this a trick question? BigGrin If you do not bind a control to a BO value then it will not manage the enabled state of the control.  So you may want to handle the EditingState event of the BO and set your label state there as well. 
By Greg McGuffey - 1/30/2007

I didn't mean it to be a trick question Whistling



This isn't about how to get something to disable when the BO idling, but how I would implement this sort of thing myself. This probably should have gone into the .NET forum.



So, the question again...



I have a button with a label to its right. The button is small, no text on it. The label is used to identify what the button will do (the text is very long for most of these buttons). E.g.



[button] Label text next to it.



If I disable the button, there is no UI clue that it is disabled (because there is no text on the button). Instead, I'd like to change the label, "gray it out", to show that the button is disabled.



As I'm still fairly clueless about .NET and how to do things, I've no idea how to do this. Where the BO/edit state comes in is simply that BOs manage this sort of thing and I figured I could learn from it BigGrin



That make more sense?
By Trent L. Taylor - 1/30/2007

Well, my previous post is at least a clue BigGrin  The IBusinessBindable interface within the framework manages this.  If you implement the IBusinessBindable interface on a control I am sure that you will start getting some ideas of how to create your own interface.

Look at the 3rd Party Data Binding sample.  This samples shows how to implement the IBusinessBindable interface.  I know that you are not trying to implement data binding in this case, but rather manage the enabled state based on some type of event.  You are going to have tie your interface or user control that you create into some type of event like the EditingStateChanged event.

By Greg McGuffey - 1/31/2007

Yep, this is the sort of clue I was looking for BigGrin Thanks, I'll take a look at the IBindableBusiness interface.