Solved

Disable form input

Posted on 2011-02-22
3
476 Views
Last Modified: 2012-08-14
Hi

I want to disable all controls on the form except command buttons

Can you help me in writing a class for this so that I can just call the class with form name
0
Comment
Question by:GRChandrashekar
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
jimsweb earned 500 total points
ID: 34958281
It think, it is better to have a looping structure than having a separate class. you can loop through all controls in your Form1 in load event and disable it.

http://www.visualstudiodev.com/visual-basic-express-edition/disable-all-controls-on-a-form-except-one-44112.shtml
0
 
LVL 8

Expert Comment

by:jimsweb
ID: 34958286
You can also have look at this discussion, in which they make all controls read only.
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_23048315.html#a20547451
0
 
LVL 20

Expert Comment

by:informaniac
ID: 34958287
foreach(Control ctrl in this.Controls){if(typeof(ctrl)!=CommandButton){ctrl.Enabled=false;
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 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