.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Disable Controls in Windows Application using C#.net

Posted By:Narayanan       Posted Date: July 30, 2012    Points: 40    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

How to disable controls in Windows Application using C#.net

 private static void DisableControls(Control.ControlCollection ctls, bool disable)
            foreach (Control ctl in ctls)
                ctl.Enabled = disable;
                DisableControls(ctl.Controls, disable);

public static void DisableTab(TabPage page, bool disable)
DisableControls(page.Controls, disable);

private void btnAction_Click(object sender, EventArgs e)
DisableTab(tabPage1, false);
btnAction.Enabled = true;




Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend