Search Tools Links Login

Disabled Text Does Not Appear Disabled


Visual Basic 6, or VB Classic

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.

Original Author: Blue Sunset Software

Code

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.

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 92 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.