Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

How to make all controls disable foreColor and BackColor same as ReadOnly = true?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ABC - 08 Aug 2006 15:53 GMT
How to make all controls disable foreColor and BackColor same as ReadOnly =
true?

As the disable textbox or another controls color is so hard to read, I want
a good method to set all control same as ReadOnly TextBox control's Colors.

There are many program code to modify if I modify from "xxx.enabled = false"
to "xxx.ReadOnly = true".  It also spend more time to retest program.  Help
Help Help.
Nkemakonam - 08 Aug 2006 20:21 GMT
You might surround your controls with a groupbox and then set the readonly
property of the groupbox to true which would make all controls inside the
groupbox read-only as well.

good luck

> How to make all controls disable foreColor and BackColor same as ReadOnly =
> true?
[quoted text clipped - 5 lines]
> to "xxx.ReadOnly = true".  It also spend more time to retest program.  Help
> Help Help.
Serpent - 09 Aug 2006 13:35 GMT
well, if u really need a generic method, you can do the following.
           1) add reference of System.Reflection
           2) and in your code, where you are performing
initialization add.
                     Assembly l_oAssembly =
Assembly.GetExecutingAssembly();
                    Types[] l_oTypes = l_oAssembly.GetTypes();

                    This array of Types is a collection of all the
propertise of your Running application. Select the appropriate type and
call "GetPropertise()" function to get the propertyInfo array. From
there, Set any value you like by calling "SetValue" function. It is by
far the best and most general method to change propertises.

> You might surround your controls with a groupbox and then set the readonly
> property of the groupbox to true which would make all controls inside the
[quoted text clipped - 11 lines]
> > to "xxx.ReadOnly = true".  It also spend more time to retest program.  Help
> > Help Help.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.