Tell me, please, how to make the tab of the control inactive?

enter image description here

For example, that "Tab2" was inactive and non-clickable (the name of the tab in gray, etc.).

The property Enabled = false is not suitable, because it simply turns off all controls on the tab, but allows you to click on it and view the contents.

Thanks in advance for your reply.

    1 answer 1

    We set for the necessary tab Enabled = false . And in combination with the following event handler, we get the desired behavior.

     private void TabControl_Selecting(object sender, TabControlCancelEventArgs e) { e.Cancel = !e.TabPage.Enabled; } 

    To make the tab caption text gray, you need to manually draw it. To do this, install tabControl.DrawMode = TabDrawMode.OwnerDrawFixed; and in the DrawItem event DrawItem draw. Examples to find is not difficult.

    See here .