6 Replies - 4809 Views - Last Post: 12 April 2009 - 12:27 PM Rate Topic: -----

#1 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

Can not convert integer into drawing point

Posted 12 April 2009 - 11:56 AM

I created a new webbrowser and it's not showing up. I can change the height but when I change the location it says can't convert integer into drawing point.

I made sure it's visible and added it in the form.

Heres' the code:

	Private Sub AddURLBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddURLBtn.Click
		Dim Height As New Point

		Dim width As New Point


		Height = 100
		width = 100





		WebSurfer = WebSurfer + 1

		Me.components.Add(URLBrowser)
		URLBrowser.Name = "Browser" + WebSurfer.ToString
		URLBrowser.Height = 100
		URLBrowser.Width = 100
		URLBrowser.Visible = True


		URLBrowser.Navigate(URL_List.Text)
		MessageBox.Show(URLBrowser.Name + URLBrowser.Location.ToString + URLBrowser.Size.ToString)





		URL_List.Items.Add(URL_List.Text)
		Urls = Urls + 1

	End Sub


Why isn't it showing up and how do I change the position of the newly created control. Thanks so much!

Is This A Good Question/Topic? 0
  • +

Replies To: Can not convert integer into drawing point

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 3873
  • View blog
  • Posts: 11,410
  • Joined: 18-April 07

Re: Can not convert integer into drawing point

Posted 12 April 2009 - 12:15 PM

Remember what a point actually is, it is a coordinate with an X and Y location just like you probably dealt with in Math on a Cartesian plane.

' Create a point that is at location 100, 100
Dim p as New Point(100,100)



Now as with any control that supports the "location" property you can pass it this point object to tell the control to move its upper left corner to that point.

' Place the browser control's upper left corner at coordinates 100, 100
' as specified by the point object "p"
URLBrowser.location = p



You can also set the location individually for a control using its left and top properties, both of these will take integer values.

URLBrowser.left = 100
URLBrowser.top = 100



So you will need to correct the lines where you setup height and width as points and trying to assign them integer values 100. Either setup the point using the constructor, like I did, or access the Point's X and Y properties and give them the integers.

Hope that answers your question!

"At DIC we be point manipulating code ninjas... you know those points of light in the night sky? Yeah we placed those there with their constructors." :snap:

This post has been edited by Martyr2: 12 April 2009 - 12:16 PM

Was This Post Helpful? 0
  • +
  • -

#3 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

Re: Can not convert integer into drawing point

Posted 12 April 2009 - 12:17 PM

Thanks man it does. Although - why isn't it showing up? The control is created and I set it to visible - any reason why it's not showing up to the specfic url?
Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 3873
  • View blog
  • Posts: 11,410
  • Joined: 18-April 07

Re: Can not convert integer into drawing point

Posted 12 April 2009 - 12:22 PM

So you are saying it is showing up and visible, but just not going to the URL you specify? Or is the control not even showing up?
Was This Post Helpful? 0
  • +
  • -

#5 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

Re: Can not convert integer into drawing point

Posted 12 April 2009 - 12:23 PM

the control isn't even showing up after the add button is pressed.
Was This Post Helpful? 0
  • +
  • -

#6 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 3873
  • View blog
  • Posts: 11,410
  • Joined: 18-April 07

Re: Can not convert integer into drawing point

Posted 12 April 2009 - 12:24 PM

Have you tried Me.Controls.add? Not components. It is a control after all. :)
Was This Post Helpful? 0
  • +
  • -

#7 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

Re: Can not convert integer into drawing point

Posted 12 April 2009 - 12:27 PM

Oh, duh! LOL! :) Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1