Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Posts
    4

    Unanswered: display attributes of labels on a form

    Hello. I am a new member. I have been a Programmer / Analyst for the past 19 years and I have been developing Access solutions for the past 8 or so. This is the first time I have not been able to easily find an answer to what should be a simply question.

    I have a really simple form with numerous textboxes (and their corresponding labels) and various assorted controls with separate labels (where applicable). I have disabled all controls until the user has selected an entry from a combobox. My problem lies with the appearance of the labels that are separate from any controls. In other words, the labels of the textboxes when disabled are grayed. I want to be able to reproduce that with the separate labels. I have fiddled with forecolor and specialeffects and can get them close but they are not exact and I'm afraid that they will be way off under other desktop colors/themes. I have toyed with the idea of using a textbox instead of a label and simply using the enabled and locked properties to reproduce the effect but I was wondering if anyone knew what effect or color or attribute I can apply to a label to make it appear EXACTLY like a label of a disabled textbox.

    Cheers.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Why not name each label or use the assigned name and disable them ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    The only way I can get it close is to add a second label behind the first with white letters. It needs to be offset one micro movement to the left and down. And the forecolor of the top label is 8421504. I don't think there is a combination of attributes you can use to accomplish this. However, if you set the visible property of the second label to true when you open the form and then set it to false when you select something from the combo box it should gie you the effect you are looking for. It might be more work than you want to manage. You can use the Tag attribute to track the extra labels and use a for each loop to turn them all of or on.

  4. #4
    Join Date
    Jun 2004
    Location
    Terrapin Nation
    Posts
    205
    Here is a thought. Add a temporary button to the form which is enabled. Under the on click events add a message box that displays the backcolor and forcolor of a disabled text box.

    That will give your the exact numbers which you need to set your labels back and forecolor too.

    make sense?

  5. #5
    Join Date
    Sep 2004
    Posts
    4
    Holy crow that was fast. Thanks. I had thought about using a "fake" or unused textbox to get me the same effect but I had not considered using a button / code to show me the attributes of a disabled textbox label. I will check that out. I thought that there may be a really simple way (i.e. label property I could manipulate) but thanks so much for the input. You guys rock.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •