|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionMany times when working with a WindowForms application I have needed to set the public void SetReadOnly(bool readOnly)
{
textBox1.ReadOnly = readOnly;
textBox2.ReadOnly = readOnly;
button1.readOnly = readOnly;
toolStripButton1.ReadOnly = readOnly;
}
However this can be tedious to manage and it woudl be nice to do this from the designer directly. The ReadOnlyController is a simple component that can be dropped on a form and can help manage the BackgroundThe ReadOnlyController is a Component so that can be dropped on a form in design mode and implements IExtenderProvider so that it can extend the properties on controls on the form. Controls that have either a
Using the codeSimply drop the ReadOnlyController on your form and since it is an // Set readOnlyController to ReadOnly to set all extended controls to ReadOnly as well
readOnlyController1.ReadOnly = true;
|
||||||||||||||||||||||||||||||