Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > MarkupLabel Control
  New Posts New Posts RSS Feed - how to bind data dynamically in markup?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to bind data dynamically in markup?

 Post Reply Post Reply
Author
Message
liwenhaosuper View Drop Down
Newbie
Newbie


Joined: 01 April 2011
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote liwenhaosuper Quote  Post ReplyReply Direct Link To This Post Topic: how to bind data dynamically in markup?
    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'?
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.140 seconds.