• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 504
  • 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
 
informaniacCommented:
foreach(Control ctrl in this.Controls){if(typeof(ctrl)!=CommandButton){ctrl.Enabled=false;
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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