Displaying icon in StatusBarPanel

K

kelvin.koogan

I want to dynamically change the icon displayed in a status bar panel.
I've created the icons in the resource file, app.rc, e.g. IDI_MYICON.
How can I load this icon and display it in the StatusBarPanel?

The auto-generated code does:

this->StatusBarPanel->Icon = (__try_cast<System::Drawing::Icon *
(resources->GetObject(S"StatusBarPanel.Icon")));

But this loads the icon from form1.resX and the icons I've defined
aren't in there.

TIA,
KK
 
E

ewpatton

I want to dynamically change the icon displayed in a status bar panel.
I've created the icons in the resource file, app.rc, e.g. IDI_MYICON.
How can I load this icon and display it in the StatusBarPanel?

The auto-generated code does:

this->StatusBarPanel->Icon = (__try_cast<System::Drawing::Icon *


But this loads the icon from form1.resX and the icons I've defined
aren't in there.

TIA,
KK

You can add the Icons into the Form1.Resx file manually in order to
access them through resources->GetObject.

Evan
 
K

kelvin.koogan

You can add the Icons into the Form1.Resx file manually in order to
access them through resources->GetObject.

Evan

Sorry to be an idiot, but how do I add icons to Form1.resX manually?
Do you mean literally cutting and pasting with a text editor?

TIA,
KK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top