h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Disable Controls in Tab Control

Today, we will discuss about How to Disable Controls in Tab Control 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; } Happy Coding!

No comments:

Post a Comment