Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable a control?

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
0
0
CA
Hi

Is there any other methods except cbo.enabled = false
to disable a combo box.
Cause once i use cbo.enabled = false, it becomes grey and that doesn't look good on my navy color form

I mean, is there any other ways to prevent the control from being changed by the user?

THanks
 
Try cbo.Locked = True

This will stop them from changing it but it won't be greyed out.

Dermot
 
Hello,

Instead of using the "enabled" method you can use the "locked" method.

cbo.locked = True

The locked method is similar to enable with a few exceptions. With locked equal to True, the field is not grey and can receive focus however the data in the field can't be modified.

If you are going to use this method to dynamically change whether a control in updatable or not, I would also use the "TabStop" method to take a diabled control out of the tab order.

cbo.TabStop = False
--------------------------------
Fortius, Citius, nullis secundus
Strength, Speed, second to none
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top