Link to home
Start Free TrialLog in
Avatar of Sandeep Sood
Sandeep SoodFlag for India

asked on

Changing the icon of control box

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.

thanks.
ASKER CERTIFIED SOLUTION
Avatar of Shauli
Shauli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of zzzzzooc
zzzzzooc

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)