F
ferg
Hey folks,
I'm new to this malarky, but I can't find anywhere an example of
programmatically recognising which tab a user has clicked.
I know it's something to do with the SelectedIndex property of the tab
object, but I can't get it into an "if" statement without it complaining.
Here's what I have...
private void fclsTabs_Load(object sender, System.EventArgs e)
{
if (this.tabControl1.SelectedIndex = 0)
txtTextBoxMain.Text = "Tab 1";
}
This complains with "Cannot implicitly convert type 'int' to 'bool' (whether
I have the "this" word in or not).
Can someone tell me what I'm doing wrong?
Thanks,
Ferg.
I'm new to this malarky, but I can't find anywhere an example of
programmatically recognising which tab a user has clicked.
I know it's something to do with the SelectedIndex property of the tab
object, but I can't get it into an "if" statement without it complaining.
Here's what I have...
private void fclsTabs_Load(object sender, System.EventArgs e)
{
if (this.tabControl1.SelectedIndex = 0)
txtTextBoxMain.Text = "Tab 1";
}
This complains with "Cannot implicitly convert type 'int' to 'bool' (whether
I have the "this" word in or not).
Can someone tell me what I'm doing wrong?
Thanks,
Ferg.