Print Page | Close Window

In markup,how to output a string variable?

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=11118
Printed Date: 06 October 2024 at 3:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: In markup,how to output a string variable?
Posted By: nihaohhh
Subject: In markup,how to output a string variable?
Date Posted: 20 June 2008 at 12:11am
Hello,
There is two problem.
 
 1.The code below?
      CString str=10000;
      CXTPControlMarkupLabel* pLabel = new CXTPControlMarkupLabel();
      pGroup->Add(pLabel, 0);
      pLabel->SetCaption(
      _T("<TextBlock  FontSize='17'><Bold>10000</Bold></TextBlock>"));
 
       I want to replace the string  "10000" with the variable str.How can I    write the code?
 
2.I want to add the character in ascii chart 2 to the markup text .How to do it?
 
Thanks a lot.

 




Replies:
Posted By: Oleg
Date Posted: 20 June 2008 at 1:34am
Just format string  before set caption;

CString strMarkup;
strMarkup.Format(_T("<TextBlock  FontSize='17'><Bold>%s</Bold></TextBlock>"), str);
pLabel->SetCaption(strMarkup);
 
2. try &#XX;


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



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