• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 507
  • Last Modified:

Disable form input

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
GRChandrashekar
Asked:
GRChandrashekar
  • 2
1 Solution
 
jimswebCommented:
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
 
jimswebCommented:
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
 
Obadiah ChristopherCommented:
foreach(Control ctrl in this.Controls){if(typeof(ctrl)!=CommandButton){ctrl.Enabled=false;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now