Results 1 to 16 of 16

Thread: Changing the Icon in a VB Form

  1. #1

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Changing the Icon in a VB Form

    THREAD RESOLVED


    Hi, how do you change the Icon in the top left of a form? I tried to change it and it couldn't find any of my pictures. Do they have to be a particular size or file type?

    Thanks
    Last edited by Pantero; Feb 16th, 2009 at 02:20 PM.
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Changing the Icon in a VB Form

    Hey,

    This is how you would do it at runtime:

    Code:
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.Icon = New Icon("1.ico")
        End Sub
    However, at design time, you can set this property in Visual Studio.

    Gary

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Changing the Icon in a VB Form

    And yes, in order to show correctly, they would have to be the same size as the default icon which shows on the form. I think this is 16x16.

    Gary

  4. #4

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Re: Changing the Icon in a VB Form

    how can i get it to the required size? And the actual size is 32X32 but what units? Also when you said "you can set this property in Visual Studio" do u mean by going on the properties of the form and clicking on the "Icon" bit?
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Changing the Icon in a VB Form

    You would need to resize the image. You can do this in any drawing package.

    And yes, that is what I mean about going to the properties.

  6. #6

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Re: Changing the Icon in a VB Form

    yes i used paint to resize it but it still cant seem to find it. Any more ideas?
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  7. #7
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: Changing the Icon in a VB Form

    If you look at the properties of the main form, there is a property called "Icon" where you can click and open a browser. Browse to the file and select it. It is expected to be of type "ico".

  8. #8

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Re: Changing the Icon in a VB Form

    yes i clicked the "Icon" and i searched for my file but it still cant seem to find it. How do i make my picture of type "ico"?
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  9. #9
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: Changing the Icon in a VB Form


  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Changing the Icon in a VB Form

    yes i clicked the "Icon" and i searched for my file but it still cant seem to find it. How do i make my picture of type "ico"?
    What do you mean you can't seem to find it?

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Changing the Icon in a VB Form

    How do i make my picture of type "ico"?
    There is actually an icon editor within Visual Studio. Right Click on your project, add new item, and then select Icon File.

    Gary

  12. #12

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Re: Changing the Icon in a VB Form

    i mean i cant find my picture when im looking for it through visual studio. I dont think its the right size.
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  13. #13

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Re: Changing the Icon in a VB Form

    oh i just saw bulldogs link and i downloaded the program and succesfully converted the icon. It is now working. Thanks

    THREAD RESOLVED
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  14. #14
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: Changing the Icon in a VB Form

    Got there in the end!

    Please mark the thread resolved.

  15. #15

    Thread Starter
    Addicted Member Pantero's Avatar
    Join Date
    Jan 2009
    Posts
    169

    Re: Changing the Icon in a VB Form

    i cant mark it resolved because i have a problem with the java script or so ive been told instead i will edit my first post and say it is resolved from there. I have already rated u positive so i cant give you positive feedback for a while. Thanks for your help bulldog and gep
    Im using visual basic 2008 express edition so any posts that include coding or stuff PLEASE refer to vb 2008.

    "A clever person solves problems, a wise person avoids them"

  16. #16
    Member
    Join Date
    Feb 2009
    Posts
    60

    Re: Changing the Icon in a VB Form

    even though the thread is resolved, you can convert your images into Icons with
    http://convertico.com
    VB 2008 Beginner
    I'll Try And Help As Much As I Can

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width