Print Page | Close Window

Set Image for CXTP Button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13674
Printed Date: 23 June 2025 at 12:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Set Image for CXTP Button
Posted By: barobax
Subject: Set Image for CXTP Button
Date Posted: 13 March 2009 at 10:28am
Hi All,
How can I set a file for button bitmap ?!?

Thanks in Advance.



Replies:
Posted By: barobax
Date Posted: 13 March 2009 at 5:15pm
hi alll,

I need set a CXTPButton bitmap ?!? I have a file on disk and it's name is image_ce.png and I want to set it to draw on my CXTPButton

Please help me,
Thanks in advance


Posted By: Oleg
Date Posted: 16 March 2009 at 7:26am
You need this method
BOOL CXTPButton::SetIcon(CSize size, const CXTPImageManagerIconHandle& hIcon, const CXTPImageManagerIconHandle& hIconHot, BOOL bRedraw/*= TRUE*/)
and
CXTPImageManagerIcon::LoadBitmapFromFile
to load bitmap.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: barobax
Date Posted: 16 March 2009 at 3:48pm
Hi oleg,
Thanks for your response, I tried to load PNF file format but it's did not successful and throw exception. CXTPImageManagerIconHandle var did not load HBITMAP

please help me,
Thanks in Advance.


Posted By: barobax
Date Posted: 16 March 2009 at 5:26pm
it's my code

    HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromFile(sFile);
    CXTPImageManagerIconHandle icoHandle = CXTPImageManagerIconHandle(hBitmap);
    m_Button_CE.SetIcon(CSize(20, 20), icoHandle);


Posted By: Oleg
Date Posted: 17 March 2009 at 1:39am
Hi,
 
Check if hBitmap is not NULL after first line. Are you sure path is correct ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: barobax
Date Posted: 17 March 2009 at 2:17am
Hi,
My hBitmap is not NULL and my path is correct.



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