Click here to Skip to main content
15,908,274 members

Comments by Samuel Corpuz (Top 9 by date)

Samuel Corpuz 4-Jan-18 23:57pm View    
Did you try to edit it?
Samuel Corpuz 4-Jan-18 23:56pm View    
go to the event of mousedown of your tabcontrol
then you will prompt to tabControl1_Mousedown

copy and paste this it will be fix
if (tabControl1.SelectedTab == tabPage2)
{
tabControl1.SelectedTab = tabPage1;
MessageBox.Show("You don’t have permission !!");
}

else if(tabControl1.SelectedTab == tabPage1)
{
tabControl1.SelectedTab = tabPage2;
MessageBox.Show("You don’t have permission !!");
}
Samuel Corpuz 4-Jan-18 22:40pm View    
upvote please
Samuel Corpuz 4-Jan-18 21:37pm View    
private void tabControl_MouseDown(object sender, MouseEventArgs e)
{
if (tabControl.SelectedTab == tabPage2)
{
tabControl.SelectedIndex = 0;
tabControl.SelectedTab = tabPage1;
MessageBox.Show("Action Denied!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (tabControl.SelectedTab == tabPage1)
{
tabControl.SelectedTab = tabPage2;
MessageBox.Show("Action Denied!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
Samuel Corpuz 4-Jan-18 21:18pm View    
try to break and continue the program, it may help to see what is the null value and error.