Print Page | Close Window

Title SetFont ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=22437
Printed Date: 18 April 2024 at 7:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Title SetFont ?
Posted By: Algae
Subject: Title SetFont ?
Date Posted: 16 October 2014 at 6:06pm
Never mind.. Solved.

This might help someone else though

Problem was blank title when setting the font via a CXTPPropertyGridItemFont:

LOGFONT lf;
ZeroMemory(&lf, sizeof(LOGFONT));
((CXTPPropertyGridItemFont*)pItem)->GetFont(&lf);
COLORREF color = ((CXTPPropertyGridItemFont*)pItem)->GetColor();

CXTPChartContent* pContent = GetEditor()->m_wndChartControl.GetContent();
CXTPChartTitle* pTitle = pContent->GetTitles()->GetAt(0);

pTitle->GetFont()->SetLogFont(&lf);

// replaced this
pTitle->SetTextColor(color);
CXTPChartColor titlecolor;
titlecolor.SetFromCOLORREF(color);
pTitle->SetTextColor(titlecolor);

// Added this to update the title
pTitle->OnChartChanged();




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