How do make textboxes, cbo, dtp  readable when "Groupbox.enabled = false"

Posted on 2009-05-01
Last Modified: 2013-12-26
i use to put (textboxes, combo, dtpicker.etc)  in a frame from vb6. In this way i can use "Frame.enabled = false" to make it readonly while the user browses the file.
When i shifted to VB2008 , i used groupbox or panel in place of frames. but when i use "groupbox.enabled = false", it grayed out all information.
What should i do to view the information in the groupbox? or to make it readonly?
I have around 30 txbox, cbo, dtp combined in the groupbox.

Question by:llouie
    LVL 48

    Expert Comment

    If you define a groupbox with enabled = false, all the controls inside will be enabled = false. That's the best solutions for cbo, dt, etc. For the textboxes you can use the readonly property instead.
    Maybe it's better to loop on all controls and set different properties for them ... some readonly (the textboxes) and some enabled = false

    Author Comment

    hi jpaulino,
    i got used to putting controls inside frame (from vb6) and just use frame.enabled=false instead of looping on all controls, (making controls ungrayed).. i noticed in you cant do that anymore, instead you have to loop on all controls.
    I just wonder if theres any other way to ungray those conrols.
    LVL 69

    Accepted Solution

    vb6 and vb 2008 have different behaviors.

    have a look at to discover how to ungray the controls (but that won't make them available)
    LVL 48

    Assisted Solution

    Check that emoreau article that does what you need, but is really necessary for you ?

    Author Closing Comment

    ok i saw the link, thanks for both of you ipaulino and emoreau. This will help me a lot.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now