Print Page | Close Window

CommandBar SetIconId = Blank image

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=22439
Printed Date: 24 November 2024 at 6:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBar SetIconId = Blank image
Posted By: sdancer75
Subject: CommandBar SetIconId = Blank image
Date Posted: 20 October 2014 at 4:21am
Hi,

I am trying to change an image icon to a CXTPControl in the command bars but instead I get blank image. The code I use is that is shown below :

CXTPControl *m_pAttachmentControl;
...............
m_pAttachmentControl = pGroup->Add(xtpControlButton, IDS_BUTTON_ATTACHMENT);
m_pAttachmentControl->SetStyle(xtpButtonIconAndCaptionBelow);


..................

if (CheckIfExistFileProjects()) {
m_pAttachmentControl->SetIconId(IDB_PNG_ATTACHMENT_FULL);
m_pAttachmentControl->RedrawParent();
} else {

m_pAttachmentControl->SetIconId(IDB_PNG_ATTACHMENT_EMPTY);
m_pAttachmentControl->RedrawParent();
}

What seems to be the problem in my code ?

Regards,



-------------
Just me!



Replies:
Posted By: sdancer75
Date Posted: 22 October 2014 at 7:54am
Ok,

What did I find. I found that 

XTPImageManager()->SetIcons(........) converts PNG or BMP files to Icons

BUT

XTPImageManager()->SetIcon(....) and PControl->SetIconId expects exclusively ICONS without the option to convert other formats (like png or bmp) to Icons. 

So if you try to use XTPImageManager()->SetIcon(....) with PNG your get Blank Dreams !

Any recommendations ?

Regards,




-------------
Just me!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net