|
I've played around a while and tested and tried a BUNCH of stuff about an icon. I've made an icon and added it to the solution explorer. Then, how do I get the icon to show up? Please help, I've honestly been doing some things to get better and dusted off the Dummies book! I know this is an easy question for most, but it gives me trouble! Thanks in advance.
|
|
|
|
|
What do you want to do with the icon?
Paul Marfleet
|
|
|
|
|
Well, I want to make it appear in the form's corner, but when I set it in the code, it fails, and when I set it in the form designer, another paper-like image replaces my icon.
|
|
|
|
|
You should be able to set the icon in the Form designer by clicking the '...' button against the Icon property and browsing to your icon file.
Paul Marfleet
|
|
|
|
|
That's what didn't work. It showed the icon next to it (mine, not the one it places), but when I start the program, it replaces it with the page-looking one... See?
|
|
|
|
|
Hi,
AFAIK there are two different icon issues:
1.
the application itself has an icon; it gets used by Windows Explorer; you set it as a project property.
2.
any form can have an icon; it is a Form property, that you can set through Visual Designer.
It also shows up in the task bar's button (if the Form shows in task bar).
BTW: if your Icon file holds more than one icon image (say at different sizes), which one
gets used depends on circumstances (e.g. small/large/detail view in Windows Explorer).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I still don't get how to show the icon.
|
|
|
|
|
"I want to make it appear in the form's corner"
that would be the Form.Icon property which you can set through Designer; there is no need
to add the icon file to the project explicitly, just open your Form Designer, choose
properties, and now hit the button at the right of the Icon property and choose.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I did it, for the last time. BUT, when the program starts, it's icon is NOT the one I chose.
|
|
|
|
|
Point is, it doesn't work (or I'm being stupid). Will anyone please help?
|
|
|
|
|
what program did you use to create the icon?
Code pre-built is code that you don't have to build later.
|
|
|
|
|
|
I mean, how did you make the icon? The icon may not be the right color bit or might be the wrong size, so therefore when you run your program, it chooses a different icon.
Code pre-built is code that you don't have to build later.
|
|
|
|
|
Oh; I added a new icon file, which is in the solution explorer. Then, I set it as the icon and it doesn't work.
|
|
|
|
|
|
I know. It says next to where you choose the icon, in a little picture, the icon I made, but when I start up, it's totally different.
|
|
|
|
|
What size icon did you create ? There's a number of sizes, it sounds like the app is choosing a different icon size, and thus reverting to the default icon.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Well, I beleive it is 32 X 32...
|
|
|
|
|
No, the icon on your form is 16x16. CTRL-PrtScn will do a screen capture of your app, then you can paste into paint to work out things like that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Icons on the form (and detail / listview in explorer) are 16*16. Try making it that size and see if you have any luck.
Also incase your interested, windows uses these icon sizes:
16*16
32*32
48*48
Just so you know
|
|
|
|
|
How would I do that? SHouldn't it be simpler than this?
|
|
|
|
|
If anyone would leave a list on how to do it, I'd be greatly appreciative, and I'll check back in a bit, but now, I have a homework spree.
|
|
|
|
|
OK, the others got close but didn't give you the little baby steps.
Open your icon in VS (where you created it)
Use Ctrl-A Ctrl-C to select the image and copy it to the clipboard
Right-click near the image
The context menu has an entry for "Current Icon Image Types", click it
You should see entries for (at least) 16x16 and 32x32, click 16x16
This will show you the 16x16 version of the icon, I suspect you didn't add your image there (it's likely all white)
Ctrl-V to paste your image, it will be too big for the icon
Then drag the lower-right corner of the image up and left to shrink the image to 16x16
Save
That should do it
|
|
|
|
|
Thank you, but I can't tell if that was an insult... If it was, keep it to yourself. No need to be short.
|
|
|
|
|
It kinda was, but mostly not.
|
|
|
|