Print Page | Close Window

how to bind data dynamically in markup?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18269
Printed Date: 16 May 2024 at 3:44pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to bind data dynamically in markup?
Posted By: liwenhaosuper
Subject: how to bind data dynamically in markup?
Date Posted: 24 April 2011 at 7:37am
for instance, i want a button show text dynamically, how can?
cstring str="helloworld"    and  in the markup text, <Button>str</Button>  ,how let it show 'helloworld' instead of 'str'?



Replies:
Posted By: mgampi
Date Posted: 25 April 2011 at 3:22pm
Hi;

Use CString::Format()

In your case

CString Caption("Hello World");
CString MarkupText;
MarkupText.Format(_T("<Button>%s</Button>"), Caption);

...




-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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