2 Replies - 686 Views - Last Post: 25 July 2009 - 10:50 PM Rate Topic: -----

#1 zenbuddhaoflove  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 25-July 09

form and webbrowser creation

Posted 25 July 2009 - 09:43 PM

ok so heres what im trying to do. I have one form with a textbox and a button. im trying to make it so that when you type in the word "internet" a new form will be created and it will have the following components inserted onto it;

one webbrowser
one textbox
eight buttons

im not really having a problem making a new form so much as having a problem putting the tools on it, heres what i have

Dim screensaver As New Form
Dim back As New Button
Dim forward As New Button
Dim internet As New WebBrowser
Dim refresh As New Button
Dim sto As New Button
Dim home As New Button
Dim close As New Button
Dim restart As New Button
Dim addressbar As New TextBox

If TextBox3.Text = "internet" Or TextBox3.Text = "Internet" Then
			screensaver.Show()
			screensaver.Height = 750
			screensaver.Width = 750
			screensaver.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
			screensaver.MaximizeBox = False
			screensaver.Contains(internet)
			internet.Show()
			internet.Height = 700
			internet.Width = 700
			internet.Navigate("www.google.com")
End If



vb doesnt say i have an error or anything like that, but i cant create "internet". i can create the form but cant put any of the components on it. can anyone possibly give me a hand?

Is This A Good Question/Topic? 0
  • +

Replies To: form and webbrowser creation

#2 LoveIsNull  Icon User is offline

  • Recovering D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 646
  • Joined: 10-March 09

Re: form and webbrowser creation

Posted 25 July 2009 - 10:08 PM

Try this,
screensaver.Controls.Add(internet)

You see, a System.Windows.Form instance has a property called Controls which is a collection of Control objects (a System.Windows.Forms.Control.ControlCollection) that are on the Form. You can add controls to the form through the Add method, passing in a reference to the control.
Was This Post Helpful? 1
  • +
  • -

#3 zenbuddhaoflove  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 25-July 09

Re: form and webbrowser creation

Posted 25 July 2009 - 10:50 PM

Thanks alot, this really helped. thanks 4 the xtra too, ive been learning vb in an akward fashion so i dont know these things
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1