9 Replies - 655 Views - Last Post: 19 November 2012 - 08:37 AM Rate Topic: -----

#1 majinvegeta010688  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-November 12

Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 07:01 AM

How do I put an Icon on the screen in visual studio 2008 in visual basic?

I want to use a ticker to move it around the screen if that is any help.

I thought i could just do it with a picture box but it didn't work so I am confused.
Is This A Good Question/Topic? 0
  • +

Replies To: Make an Icon viewable in visual basic 2008

#2 biggerB  Icon User is offline

  • Inactive
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 07:21 AM

An icon as in a vector .ico graphics? Or is it just an image with transparency?
Was This Post Helpful? 0
  • +
  • -

#3 majinvegeta010688  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-November 12

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 07:28 AM

.ico
Was This Post Helpful? 0
  • +
  • -

#4 biggerB  Icon User is offline

  • Inactive
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 07:43 AM

You can load the .ico file through the program, As long as you don't have option strict on, This automatically converts the icon into a bitmap, which you can then show in a picturebox in your form
        Dim bmmp As Bitmap = Bitmap.FromFile("Logo2,3.ico")
        PictureBox1.Image = bmmp

Was This Post Helpful? 0
  • +
  • -

#5 majinvegeta010688  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-November 12

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 07:51 AM

where do I put the image? Do I put it in a particular folder or what???
Was This Post Helpful? 0
  • +
  • -

#6 biggerB  Icon User is offline

  • Inactive
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 07:54 AM

The code that i provided before, puts the ico file in the same directory as your program. But you can set the path to any place on your computer. So just replace the "Logo2,3.ico" with the full path of the ico file
Was This Post Helpful? 0
  • +
  • -

#7 majinvegeta010688  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-November 12

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 08:05 AM

Is there another way to do this because the path isn't working.

I put the .ico file in the my projrct folder.

it needs to be transfurrable so the path doesn't need to be changed.
Was This Post Helpful? 0
  • +
  • -

#8 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 233
  • View blog
  • Posts: 770
  • Joined: 19-October 11

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 08:23 AM

In upper menu click on Project, and Properties (or right-click on project in solution explorer, and then on properties).
When project's properties are opened, select Resources tab, and click on Add Resource dropdown. There you click on Add Existing File, and search for the image you want to add. You can assign its name, and then use it like this (suppose you named it MyIcon):
PictureBox1.Image = My.Resources.MyIcon
Was This Post Helpful? 0
  • +
  • -

#9 majinvegeta010688  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-November 12

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 08:37 AM

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        BikePictureBox.Image = My.Resources.Bicycle.ico
    End Sub



The error i get is ico is not a member of 'system.drawing.icon'
Was This Post Helpful? 0
  • +
  • -

#10 biggerB  Icon User is offline

  • Inactive
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Make an Icon viewable in visual basic 2008

Posted 19 November 2012 - 08:37 AM

Do
BikePictureBox.Image = My.Resources.Bicycle.ToBitmap
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1