Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets
  New Posts New Posts RSS Feed - TIP: XAML Markup & Labels
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TIP: XAML Markup & Labels

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: TIP: XAML Markup & Labels
    Posted: 10 May 2008 at 6:56pm
Using markup with the CJ label control is a great way to get rich presentation for your apps, but the XAML strings can get a bit unwieldy (due to their length and internal quotation marks in particular). Here's my solution:

  1. Create the markup in the MarkupPad and then save the file to <something>.xaml
  2. Start VB6, and make sure the VB6 Resource Editor add-in is loaded in the Add-ins menu > Add-in Manager
  3. If your project doesn't already have a resource file associated with it, click the Project menu, and then click Add New Resource File.
  4. Save the new resource file (for example, xaml.res).
  5. In the Project Explorer window, under "Related Documents", double-click your resource file to open the Resource Editor.
  6. In the resource editor toolbar, click the "Add Custom Resource" icon.
  7. Navigate to the file you saved from the MarkupPad and select it. For the purpose of this example, we'll assume it is resource #101.
  8. Click the Save icon to save the resource file (important step!)
  9. Close the Resource Editor.
The markup is now available for use in your application. To load the resource into a CJ label:


   Me.Label1.Caption = StrConv(LoadResData(101, "CUSTOM"), vbUnicode)


The StrConv call is required because the LoadResData function returns the bytes exactly as they are stored in the file (non-unicode), but VB6 requires unicode strings.

Anyway, this might be an obvious route to most of you, but I thought it could be helpful to others. Perhaps you've found a better solution that you can post here?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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.168 seconds.