dimming labels

yoavchen

Registered User.
Local time
Today, 08:07
Joined
Jan 31, 2005
Messages
53
how can i dim label that i wtn it to be disable...but visible.
i know i can do it with command button but i dont know how can i do it with label.
 
You should be able to use Conditional Formatting in the Format menu to disable the control which will also dim the label.
 
the conditional formating does not work on lables.
 
There is no Enable property for labels. There is no need to Disable them because the user is unable to interact with them in the same way they would with a textbox or a command button.
 
To modify the representation of a label you must know which label goes with which control. It isn't always so easy to know that, depending on the way the control was created. However, if you want to disable a control, make yourself a subroutine for which you supply three arguments: two controls and a yes/no field.

Inside the subroutine (which should be a Public Sub in a general module), you can look at the Yes/No field and the two controls. If either control is a label, you can set the ForeColor or change the BackColor or both. You have to look at the .Type property of the control to know that it is a label control. If the other control isn't a label, it will likely have a .Enabled property and a .Visible property, both of which can be set or cleared in your routine.

Once you have this subroutine, you can choose to call it from event code underlying your form. I did this once or twice. In my case, I just made a sequence of calls to enable or disable textboxes, to be run every time certain fields got changed. I passed in the names of the control and its associated label and my state selector.
 
Similar Problem

Hi

You've probably found the answer to your question. But I had a similar problem where I wanted to join labels to combo boxes and buttons. I had deleted the label that was generated with them so had created labels via the toolbox. As I only wanted them to disabled and enabled for formatting and appears reasons with their corresponding control I wanted to join them up.

What I found out was in design view, cut the label, select the combo box or whatever control you want and paste the label. So as a result my label is associated with the combo box.

Sarah
 
Sarah31 said:
Hi

You've probably found the answer to your question. But I had a similar problem where I wanted to join labels to combo boxes and buttons. I had deleted the label that was generated with them so had created labels via the toolbox. As I only wanted them to disabled and enabled for formatting and appears reasons with their corresponding control I wanted to join them up.

What I found out was in design view, cut the label, select the combo box or whatever control you want and paste the label. So as a result my label is associated with the combo box.

Sarah


That works and is easy to do, thanks for the tip :D
 

Users who are viewing this thread

Back
Top Bottom