Print Page | Close Window

Problems goig from CXTButton to CXTPButton

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=23544
Printed Date: 29 March 2024 at 9:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problems goig from CXTButton to CXTPButton
Posted By: eggbox
Subject: Problems goig from CXTButton to CXTPButton
Date Posted: 19 January 2018 at 12:38pm
We recently upgraded to version 18.2 from 17.2 and we are looking at code that uses CXTButton and would like to upgrade to CXTPButton since the former is deprecated.

The code in question creates a button and as a flat button style with an image, with no code changes the button does not show the image at all.

Some code (rcButtonPos and pParent are set correctly)

-----
CXTPButton btn;
btn.Create(_T(""), WS_CHILD|BS_NOTIFY|WS_VISIBLE|WS_TABSTOP, rcButtonPos, pParent, 100);
btn.SetButtonStyle(BS_XT_SEMIFLAT|BS_XT_SHOWFOCUS );
CBitmap bitmap; 
bitmap.LoadBitmap(uID);  // Load image from resources
CSize size = bitmap.GetBitmapDimension(); 
btn.SetBitmap(size, uID);
-----
It seems like I am doing everything correctly but all get is the default button images, e.g.


Does anyone have an idea of what I am doing wrong?
Thanks in advance.


-------------
//*eggbox

Product: Xtreme ToolkitPro v18.2.0
Platform: Windows 7 (32 bit)
Language: C++ / MFC



Replies:
Posted By: cluster
Date Posted: 20 January 2018 at 7:17am
Hi

i think you should try:
btn.SetBitmap(size/3uID);


-------------
Windows 7
Visual Studio 2013
CodeJock 18.6



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