Picture Control
-
Hi, I have problem with Picture control in my project. I am using 3 dialogs. When I put Picture control on my dialog and set properties: Type to Icon, Image is icon ID from resource so I see icon icon in the Picture control - everything looks ok. But when I build the program so I see different icon in the Picture control - I see a cursor icon(white arrow with question mark) instead of my icon from resource. This is definition of Picture control from my resource: ICON IDI_ICON2,IDC_STATIC_ICON,181,154,20,20,0 The value of IDI_ICON2 is 112 I tried create a new project with one dialog box. It was working without any problems. What am I doing wrong. Thanks.
-
Hi, I have problem with Picture control in my project. I am using 3 dialogs. When I put Picture control on my dialog and set properties: Type to Icon, Image is icon ID from resource so I see icon icon in the Picture control - everything looks ok. But when I build the program so I see different icon in the Picture control - I see a cursor icon(white arrow with question mark) instead of my icon from resource. This is definition of Picture control from my resource: ICON IDI_ICON2,IDC_STATIC_ICON,181,154,20,20,0 The value of IDI_ICON2 is 112 I tried create a new project with one dialog box. It was working without any problems. What am I doing wrong. Thanks.
No idea what could be wrong there but did you try changing the value of IDI_ICON2 from 112 to something else, for example to 1000?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
No idea what could be wrong there but did you try changing the value of IDI_ICON2 from 112 to something else, for example to 1000?
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
Hi, thanks for reply. When I changed the value to 2000 so I see nothing. There is no icon.
Clean and rebuild your project and see if anything changes.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
Clean and rebuild your project and see if anything changes.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
I see...did you maybe -by mistake- add your icon as cursor resource instead of icon resource, or maybe selected cursor -if possible- instead of icon for the picture control? Does the arrow with questionmark cursor thing appear again if you change the ID back to 112? I did some look around and 112 seems to be the resource ID of the standard "arrow with questionmark" mouse cursor, so my guess is that someone somewhere loads a cursor instead of an icon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
modified on Saturday, February 28, 2009 2:39 PM
-
I see...did you maybe -by mistake- add your icon as cursor resource instead of icon resource, or maybe selected cursor -if possible- instead of icon for the picture control? Does the arrow with questionmark cursor thing appear again if you change the ID back to 112? I did some look around and 112 seems to be the resource ID of the standard "arrow with questionmark" mouse cursor, so my guess is that someone somewhere loads a cursor instead of an icon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
modified on Saturday, February 28, 2009 2:39 PM
I checked it all over again - when I change the value to 2000 I see nothing, to 113 I se different cursor(pen). In the type properties there is value Icon. There are no curors in the my resource. I see the icon in the Icon folder in the Resource viewer(there are no cursors).
-
I checked it all over again - when I change the value to 2000 I see nothing, to 113 I se different cursor(pen). In the type properties there is value Icon. There are no curors in the my resource. I see the icon in the Icon folder in the Resource viewer(there are no cursors).
Well, if you don't mind the workaround, i suggest setting the icon from code using CStatic::SetIcon[^] instead of using the resource...that should help, just use LoadIcon[^] or CWinApp::LoadIcon[^] and then set this to your static control. Don't forget to use DestroyIcon[^] once you are done with it. Your dialog's OnInitDialog[^] is a good place for setting the icon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
modified on Saturday, February 28, 2009 3:34 PM
-
Well, if you don't mind the workaround, i suggest setting the icon from code using CStatic::SetIcon[^] instead of using the resource...that should help, just use LoadIcon[^] or CWinApp::LoadIcon[^] and then set this to your static control. Don't forget to use DestroyIcon[^] once you are done with it. Your dialog's OnInitDialog[^] is a good place for setting the icon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
modified on Saturday, February 28, 2009 3:34 PM
SendDlgItemMessage(hDlg,IDC_LOGO, STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM) LoadIcon(ghInstance,MAKEINTRESOURCE(IDI_ICON1))); I see nothing; GetLasterror returns - The specified resource type cannot be found in the image file. But this icon - IDI_ICON1 is there because I use it as icon for exe file and for title bar. I am giving up. Thanks for you time.