PC Review


Reply
Thread Tools Rate Thread

How do I disable a container without changing the style of contained controls?

 
 
Joseph Geretz
Guest
Posts: n/a
 
      13th Jul 2009
I want to disable a whole group of controls, but I don't want to change the
UI appearance of these controls. I've placed all of these controls onto a
Group Box and so I can physically restrict access to the entire group en
masse by simply disabling the group box. When I do this, I'd like the
contained controls to remain visually unchanged.

How can this be done?

Thanks very much for your help!

Joseph Geretz


 
Reply With Quote
 
 
 
 
Aaron Moore
Guest
Posts: n/a
 
      13th Jul 2009
Does the group box have a "read-only" property that you can use? Alot of
DevExpress controls have a read-only property that I use often...

"Joseph Geretz" <(E-Mail Removed)> wrote in message
news:u9feB1%(E-Mail Removed)...
>I want to disable a whole group of controls, but I don't want to change the
>UI appearance of these controls. I've placed all of these controls onto a
>Group Box and so I can physically restrict access to the entire group en
>masse by simply disabling the group box. When I do this, I'd like the
>contained controls to remain visually unchanged.
>
> How can this be done?
>
> Thanks very much for your help!
>
> Joseph Geretz
>


 
Reply With Quote
 
Joseph Geretz
Guest
Posts: n/a
 
      13th Jul 2009
Hi Aaron,

We are using the standard VS GroupBox. Unfortunately, it does not provide
the ReadOnly property.

Thanks for your suggestion.

Joseph Geretz

"Aaron Moore" <(E-Mail Removed)> wrote in message
news:%23uJqGQ$(E-Mail Removed)...
> Does the group box have a "read-only" property that you can use? Alot of
> DevExpress controls have a read-only property that I use often...
>
> "Joseph Geretz" <(E-Mail Removed)> wrote in message
> news:u9feB1%(E-Mail Removed)...
>>I want to disable a whole group of controls, but I don't want to change
>>the UI appearance of these controls. I've placed all of these controls
>>onto a Group Box and so I can physically restrict access to the entire
>>group en masse by simply disabling the group box. When I do this, I'd like
>>the contained controls to remain visually unchanged.
>>
>> How can this be done?
>>
>> Thanks very much for your help!
>>
>> Joseph Geretz
>>

>



 
Reply With Quote
 
Tamer Oz [MVP]
Guest
Posts: n/a
 
      24th Jul 2009
Hi,

textBox1.Enabled=false;

textBox1.BackColor = Color.White;

textBox1.ReadOnly = true;

this should do the job, but hard to implement.

I recommend you to create a base Textbox class which overrides enabled property or has another property and executes the code above. After that inherit all your textboxes from this class.

"Joseph Geretz" <(E-Mail Removed)> wrote in message news:OiODDp$(E-Mail Removed)...
Hi Aaron,

We are using the standard VS GroupBox. Unfortunately, it does not provide
the ReadOnly property.

Thanks for your suggestion.

Joseph Geretz

"Aaron Moore" <(E-Mail Removed)> wrote in message
news:%23uJqGQ$(E-Mail Removed)...
> Does the group box have a "read-only" property that you can use? Alot of
> DevExpress controls have a read-only property that I use often...
>
> "Joseph Geretz" <(E-Mail Removed)> wrote in message
> news:u9feB1%(E-Mail Removed)...
>>I want to disable a whole group of controls, but I don't want to change
>>the UI appearance of these controls. I've placed all of these controls
>>onto a Group Box and so I can physically restrict access to the entire
>>group en masse by simply disabling the group box. When I do this, I'd like
>>the contained controls to remain visually unchanged.
>>
>> How can this be done?
>>
>> Thanks very much for your help!
>>
>> Joseph Geretz
>>

>



 
Reply With Quote
 
Aaron
Guest
Posts: n/a
 
      5th Aug 2009
You can handle the GroupBox_Enter event. Cause it to force focus onto
another control. You can even set a flag to let the event know if it should
allow the group box to get focus or not.

VB.NET

Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GroupBox2.Enter

If Not IsAllowedFocus Then
'set focus to another control
Button3.Focus()
End If


End Sub

"Joseph Geretz" <(E-Mail Removed)> wrote in message
news:u9feB1#(E-Mail Removed)...
> I want to disable a whole group of controls, but I don't want to change
> the UI appearance of these controls. I've placed all of these controls
> onto a Group Box and so I can physically restrict access to the entire
> group en masse by simply disabling the group box. When I do this, I'd like
> the contained controls to remain visually unchanged.
>
> How can this be done?
>
> Thanks very much for your help!
>
> Joseph Geretz
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing control style (look) while in disable mode esakal Microsoft C# .NET 0 6th Sep 2006 11:17 PM
Getting properties of container into contained controls. Ray Cassick \(Home\) Microsoft VB .NET 1 11th Apr 2005 04:11 AM
Validation of container controls containing other container controls George Jordanov Ivanov Microsoft Dot NET Framework Forms 0 6th Jan 2005 09:37 AM
How to determine minimum size of a container to show all controls in the container? John Microsoft Dot NET Framework Forms 1 26th Aug 2004 05:37 PM
Make Container UserControl force controls to be added to a child container control Codemonkey Microsoft Dot NET Framework Forms 2 21st Nov 2003 08:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:02 AM.