Solved

Disable form input

Posted on 2011-02-22
3
456 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
Comment Utility
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
Comment Utility
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
Comment Utility
foreach(Control ctrl in this.Controls){if(typeof(ctrl)!=CommandButton){ctrl.Enabled=false;
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now