[Solved] How can i disable moving between Tab Control tabs by mouse in c# [closed]


This doesn’t really make a lot of sense.

Short of disabling the mouse cursor entirely, I don’t know how you would possibly achieve this. Even if there were a way of “ignoring” mouse clicks on the tab control tabs, that would be incredibly bad UI. As far as the user would be concerned, your application would be pathetically broken—“I try to do the same thing I do in all other apps, but this one just sits here like it’s dead. Stupid buggy program.”

So that’s a non-starter. If the goal here is to force the user to navigate through the tabs in a particular order (like a wizard), then I recommend just hiding the tabs altogether. Then the user won’t be tempted to click on them or switch between them in an arbitrary order. You will have to control tab switching through code, by setting the SelectedTab or SelectedIndex property. This will also give you a place to run any additional code that you want when switching tabs.

You’ll find instructions on how to hide the tabs on the TabControl in Hans’s answer here.

solved How can i disable moving between Tab Control tabs by mouse in c# [closed]