Changing the icon of control box

Posted on 2004-11-14
Last Modified: 2013-11-19
how do i change the icon of the control box from default vb icon to any other icon. Do i need .ico file for the image to be displaye in the control box icon or any .bmp, .gif, .jpg will work.
and Please, i need the soloution without API.

Question by:thetechguy
    LVL 19

    Accepted Solution

    If you refer to the form icon (on the upper left corner) then simply scroll the FORM's properties window to "Icon" and select the icon you wish by browsing to it.

    LVL 32

    Expert Comment

    To assign a new icon with your application, set the main form's icon property to an ICO file.  The file should be a standard icon.  Your ICO file should have at least 2 icons in it, One 16x16 pixels, and one 32x32 pixels (both 16 or 256 colors).

    You then assign your application the icon in the Project->Properties menu and select the form who's icon you want to use.
    LVL 17

    Expert Comment

    If you want the option at run-time, you can set the form's Icon property to an icon loaded with LoadPicture() or LoadResPicture().

        Form1.Icon = LoadPicture("C:\MyIcon.ico")
        '101 is the ID of the icon in Resource Editor
        Form1.Icon = LoadResPicture(101, vbResIcon)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now