Link to home
Start Free TrialLog in
Avatar of llouie
llouie

asked on

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

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.

Thanks.
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

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
Avatar of llouie
llouie

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of llouie

ASKER

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