hello every one i found a solution for my problem
fist:
add a tab control,and a button on my project and the add this two methods to my project:
public static void EnableTab(TabPage page, bool enable)
{
EnableControls(page.Controls, enable);
}
private static void EnableControls(Control.ControlCollection ctls, bool enable)
{
foreach (Control ctl in ctls)
{
ctl.Enabled = enable;
EnableControls(ctl.Controls, enable);
}
}
and then double click on the button and add this line to disable tab page :
private void button1_Click(object sender, EventArgs e)
{
EnableTab(tabControl1.TabPages[tabControl1.SelectedIndex = 0], false);
}
and for enable it i add an other button and add this line to enable tab page:
private void button1_Click(object sender, EventArgs e)
{
EnableTab(tabControl1.TabPages[tabControl1.SelectedIndex = 0], true);
}
resource:
Barnamenevis.org