I have Form1 which has a TabControl. There are 2 TabPages within tabControl1 , namely tabpage1 and tabpage 2 . I would like to know if its possible to disable the selection of tabpage2 unless all criteria of tabpage1 are satisfied .
I do not see any enable or visible properties for each individual tabpage .
You can hook into the TabControl.SelectedIndexChanged event, or in some cases its better to hook into the TabControl.Selecting event.
Then in the event validate the criteria you have for the tab you are on, if it is good, then you’re fine, if it isn’t complete/invalid, then you can Cancel the tab change(using the e.Cancel for instance from the Selecting event, see example on linked page) from these events, putting you right back where you were and hopefully with a messagebox or something to show the user what is wrong with the input.