I want to make a webbrowser with only 5 tabpages.
but i have in every tabpage an webbrowser , so i tried this
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
If TabControl1 = TabPage1 Then
WebBrowser1.Navigate(ComboBox1.Text)
End If
If TabControl1 = TabPage2 Then
WebBrowser2.Navigate(ComboBox1.Text)
End If
If TabControl1 = TabPage3 Then
WebBrowser3.Navigate(ComboBox1.Text)
End If
If TabControl1 = TabPage4 Then
WebBrowser4.Navigate(ComboBox1.Text)
End If
If TabControl1 = TabPage5 Then
WebBrowser5.Navigate(ComboBox1.Text)
End If
End Sub
And I get this error in my error list 5 times:
Error 1 Operator '=' is not defined for types 'System.Windows.Forms.TabControl' and 'System.Windows.Forms.TabPage'.
Software/Hardware used:
Visual basic 2010 Express
ASKED:
October 13, 2012 7:42 AM
You can’t use “=” for those. You can possibly use the Object.Equals method; it’s valid for System.Windows.Forms objects. I don’t know what you can expect, though, because I don’t see how anything is created. — Tom
TabControl and TabPage are different types. You can’t compare them.
If you want to determine the currently selected tab page you will need to use the TabControl’s SelectedTab property.