|
-
July 18th, 2002, 05:22 AM
#1
how to display icon in a dialog box,urgent
Hi!
How to display icon in a dialog box?
Gupta.
-
July 18th, 2002, 05:37 AM
#2
DrawIcon API
All you need to do to draw an icon in the dialog is load the icon in and use the api, DrawIcon(..).
DrawIcon(hDC, x_position, y_position, hIcon);
for example, if you have an icon as a resource in your file - e.g. IDI_ICON1
you would do something like this:
HICON hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
DrawIcon(hDC, 10, 10, hIcon);
Hope this helps
Ben
-
July 18th, 2002, 06:03 AM
#3
Inserting Icon
Hello,
Try this:
First of all insert an icon in to your poject by clicking the insert menu in your editor and then click Resource and then click icon.To add an existing icon click import and give the path of icon file in the select box which appear on clicking import.To add a new icon click new and design it using the pen and colours.Now in your resource view under Icon section you can see that icon (say IDI_ICON1).Now insert a picture control to your dialog.Right click your mouse and take its property.In that drop down the combo seen against type and select I con.Now the combo against Image will be visible.Drop down it and select your icon name(say IDI_ICON1).Close the propertis Dialog.Now the icon will be visible in your dialog.You can move it to whatever position you like in your Dialog.
Let me know is it helpful to you.
Shibu K.V.
Sr.Research Associate
VLSI-ASIC Hardware Design Group
Electronics R&D Centre of India,
Trivandrum,Kerala
India
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|