Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - [SOLVED]MarkupImage should implement MarkupInline?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED]MarkupImage should implement MarkupInline?

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED]MarkupImage should implement MarkupInline?
    Posted: 02 March 2010 at 4:37pm
Using Markup strings, you can do something like this:


<TextBlock ><Hyperlink><Image Source='file://C:/winnt/Coffee Bean.bmp'/>Link with Image</Hyperlink></TextBlock>


to include an image in a hyperlink.

However, with the MarkupLabel & MarkupObjects, this fails (Type mismatch):


   Dim mc As XtremeMarkup.MarkupContext
   Dim lo_Hyperlink As XtremeMarkup.MarkupHyperlink
   Dim lo_HyperlinkText As XtremeMarkup.MarkupRun
   Dim lo_Image As XtremeMarkup.MarkupImage
  
   Set mc = UserControl.MarkupLabel1.MarkupContext
   mc.SetHandler Me
     
   Set lo_HyperlinkText = mc.CreateObject("Run")
   lo_HyperlinkText.Text = "Add a new contact"
  
   Set lo_Image = mc.CreateObject("Image")
   lo_Image.Source = "file://C:/winnt/Coffee Bean.bmp"
  
   Set lo_Hyperlink = mc.CreateObject("Hyperlink")
   With lo_Hyperlink
      .AddHandler .ClickEvent, "AddContact"
     
      .Inlines.Add lo_Image   ' TYPE MISMATCH HERE
      .Inlines.Add lo_HyperlinkText
   End With


Should the MarkupImage object implement the MarkupInline interface?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 March 2010 at 1:43am
Hi,
 
When Markup Parser see Inline that is not Inline type object it automatically add parent InlineUIContainer for it.
 
So your code should look like
 
 
Dim lo_Container As XtremeMarkup.MarkupInlineUIContainer
Set lo_Container = mc.CreateObject("InlineUIContainer")

lo_Container.Child = lo_Image
.Inlines.Add lo_Container
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2010 at 12:27am
Thanks a lot Oleg, that worked great.

The parser seems to do this automatically for MarkupRun objects - can it do it automatically for MarkupImage objects so we don't have to go through the extra container steps?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2010 at 6:20am
Hi,
 
You need it for Image - MarkupImage is FrameworkElement derived class.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.141 seconds.