[Last Call] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2009-05-01
Medium Priority
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
  • 2
  • 2
LVL 48

Expert Comment

ID: 24285453
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

ID: 24285924
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 vb.net 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 70

Accepted Solution

Éric Moreau earned 1000 total points
ID: 24285948
vb6 and vb 2008 have different behaviors.

have a look at http://www.emoreau.com/Entries/Articles/2005/07/Colors-of-disabled-controls.aspx to discover how to ungray the controls (but that won't make them available)
LVL 48

Assisted Solution

jpaulino earned 1000 total points
ID: 24286299
Check that emoreau article that does what you need, but is really necessary for you ?

Author Closing Comment

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month17 days, 21 hours left to enroll

831 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