Im trying to make a webbrowser and I have a Type Expected error and it wont go away. What i want this code to do is go to the website, then set toolstriptextbox1.text into the value of webbrowser.url.
Here is my code:
Private Sub ToolStripButton4_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton4.Click
ToolStripTextBox1.Text = (CType (TabControl1.SelectedTab.Controls,(WebBrowser.URL)) 'It happens at the first bracket around Webbrowser.url'
(toolstripbutton4 is the 'go' button)
(also the webbrowser is in a tab with a add tab option)
think about it... CType takes two parameters... right? The first being the Object you want to re-type... and the second is the type you want to cast it to... you got it right in the line just before...
That doesnt really help, but i changed it and same error.
Here is the modified code.
CType(TabControl1.SelectedTab.Controls,'RIGHT HERE'(WebBrowser.locationURL)) = (ToolStripTextBox1.Text)
That said... you really should be declaring a variable of type WebBrowser, setting it to the control, and then accessing everything through the variable... it's going to be a lot easier and more efficient than repeatedly CTyping the control.
I've thought long and hard on how to respond to this... because quite frankly my initial reaction was one that could quite possibly get me banned from here for a couple months...
Instead I'm going to make two comments, then I'm done with this thread.
1) since you are using the value in the textbox to navigate the webbrowser... why would you want to reset it back to the same value?
2) Think about the line with the blue squiggle... there are two things wrong with it... 1) your assignment is backwards... I tried to point this out in post #6 you either ignored it or simply refused to listen. It's a simple variable assignment... you're trying to do this: 15 = x .... that just doesn't work. 2) every object inherits from the base object class... funny thing about the base object class... it has a ToString method... guess what it does?
I get the feeling you're just flailing about and not really understanding what you're doing. Nor do you seem to care about what you're doing, because you've flubbed up some of the most basic things, even when I can see that you get it right in other areas.
I can only come to one of two conclusions... and the other is that this is a joke.