?
Solved

Disable form input

Posted on 2011-02-22
3
Medium Priority
?
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
jimsweb earned 2000 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

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.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 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