|
-
Feb 11th, 2015, 11:44 PM
#1
Thread Starter
Member
Tab control1 is not a member of system.windows.forms.tab page
its really pissing me off heres my code :
Code:
Public Class Tab
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
AxWebBrowser1.Navigate(TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
AxWebBrowser1.GoForward()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
AxWebBrowser1.GoBack()
End Sub
Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event)
End Sub
Private Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseToolStripMenuItem.Click
Stop
End Sub
Private Sub ChnagelogToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChnagelogToolStripMenuItem.Click
information.Show()
End Sub
Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
AxWebBrowser1.GoForward()
End Sub
Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.Click
AxWebBrowser1.GoBack()
End Sub
Const navigate As String = ""
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
End If
End Sub
Private Sub gotoURL(ByVal str As String)
If str = vbNullString Then
MsgBox("Enter A valid URL address")
Exit Sub
If str.Substring(0) <> "http://" Then
str = "http://" + str
End If
Process.Start(str)
End If
End Sub
Private Sub UpdateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateToolStripMenuItem.Click
CheckForUpdates()
End Sub
Public Sub CheckForUpdates()
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://www.dropbox.com/s/yswirvjlx24qxez/Version%20info.txt?dl=1")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream)
Dim newestversion As String = sr.ReadToEnd()
Dim currentversion As String = Application.ProductVersion
If newestversion.Contains(currentversion) Then
MsgBox("No update needed")
Else
MsgBox("Click OK to update: to update just download the file that you got and replace it in C:\Program Files (x86)\Xpress Web")
System.Diagnostics.Process.Start("https://www.dropbox.com/s/fw2w8g6limflq1p/Xpress%20Web%20V1.0.0.1.exe?dl=1")
End If
End Sub
Private Sub HistoryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HistoryToolStripMenuItem.Click
History.Visible = True
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
Dim AxWebBrowser As New WebBrowser
TextBox1.Text = AxWebBrowser1.ToString()
My.Settings.History.Add(AxWebBrowser1.ToString)
History.ListBox1.Items.Add(AxWebBrowser1.ToString)
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
Dim tab As New TabPage
Dim newtab As New Tab
newtab.Show()
newtab.Dock = DockStyle.Fill
newtab.TopLevel = False
tab.Controls.Add(newtab)
tab.TabControl1.TabPages.Add(tab)
End Sub
End Class
the error is under tab.tabcontrol1.tabpages.add(tab)
Last edited by austen; Feb 11th, 2015 at 11:45 PM.
Reason: adding information
-
Feb 12th, 2015, 01:11 AM
#2
Re: Tab control1 is not a member of system.windows.forms.tab page
Um:
Code:
Dim tab As New TabPage
`tab` is a TabPage. Since when has a TabPage object had a member named TabPage1? I'm guessing that you actually meant `newtab.TabControl1`. You might think about using some better names for types and variables there.
-
Feb 12th, 2015, 11:54 AM
#3
Thread Starter
Member
Re: Tab control1 is not a member of system.windows.forms.tab page
-
Feb 12th, 2015, 11:57 AM
#4
Thread Starter
Member
Re: Tab control1 is not a member of system.windows.forms.tab page
nevermind i just had to delete tab bfore tabcontrol1
-
Feb 12th, 2015, 12:19 PM
#5
Re: Tab control1 is not a member of system.windows.forms.tab page
You were probably running into an issue because you named the form itself Tab, then had a local variable named tab, as well. Therefore, you likely had a default instance of the form called Tab, a class type called Tab, and a local variable called Tab. The compiler decided you meant one thing when you meant something else. It's likely just a case of name confusion.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|