VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Disabled Text Does Not Appear Disabled

by Blue Sunset Software (1 Submission)
Category: Coding Standards
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

This tip is on the off chance you want to break with GUI standards and show a disabled text box (or other control) without the typical grayed out "disabled" look.

Rate Disabled Text Does Not Appear Disabled

Because of GUI standards, you wouldn't want to use this technic very often. But there are circumstance in which you want to present data without allowing the user editing privileges.
Just using the locking mechanism still allows the user to to click in the control, highlight the text and shows up in the tab order. Here is a better way.
Add a frame to your form. Set the border style to 0 - None. Place the text box in the frame (with with its accompaning label) at the top of the frame. Size the frame to show just the text box and its label. Now you can control the enable/disable property on the frame.
The text box and label appear normal but it won't allow the user the click in the box, tab to the control or edit data when the frame is disabled. To allow the user access, just enable the frame.

Download this snippet    Add to My Saved Code

Disabled Text Does Not Appear Disabled Comments

No comments have been posted about Disabled Text Does Not Appear Disabled. Why not be the first to post a comment about Disabled Text Does Not Appear Disabled.

Post your comment

Subject:
Message:
0/1000 characters