MarkupUIElement Property
See Also

| Markup ActiveX Control v24.0 | ||||||||
|---|---|---|---|---|---|---|---|---|
Description
Allows XML Markup created in code to be assigned to the MarkupLabel.
Property Type
Read-write property
Syntax (Visual Basic)
Public Property MarkupUIElement() As MarkupUIElement
Remarks
When using the MarkupLabel control, Markup can be created in code without needing to parse a long markup string. For example, the Markup string "..." can be created in code using:
Set Grid1 = Context.CreateObject("Grid")
This is accomplished by setting the MarkupUIElement property to a Markup object created in code:
Set MarkupLabel1.MarkupUIElement = StackPanel
Example
Dim StackPanel As MarkupStackPanel
Set StackPanel = Context.CreateObject("StackPanel")
StackPanel.Orientation = xtpMarkupOrientationVertical
StackPanel.Children.Add TextBlock1
StackPanel.Children.Add Border
StackPanel.Children.Add Canvas
Set e = Context.Parse("WrapPanelText")
StackPanel.Children.Add e
StackPanel.Children.Add Context.Parse("DockPanelText")
StackPanel.Children.Add Context.Parse("")
StackPanel.Children.Add Context.Parse("")
StackPanel.Children.Add Context.Parse("")
StackPanel.Children.Add Context.Parse(" It was rectangle")
Dim Grid1 As MarkupGrid, GridEllipse1 As MarkupEllipse, GridEllipse2 As MarkupEllipse, GridEllipse3 As MarkupEllipse
Dim ColumnDef As MarkupColumnDefinition, RowDef As MarkupRowDefinition
Set Grid1 = Context.CreateObject("Grid")
Set ColumnDef = Context.CreateObject("ColumnDefinition")
Grid1.ColumnDefinitions.Add ColumnDef
Set ColumnDef = Context.CreateObject("ColumnDefinition")
Grid1.ColumnDefinitions.Add ColumnDef
Set RowDef = Context.CreateObject("RowDefinition")
Grid1.RowDefinitions.Add RowDef
Set RowDef = Context.CreateObject("RowDefinition")
Grid1.RowDefinitions.Add RowDef
Set GridEllipse1 = Context.CreateObject("Ellipse")
Set GridEllipse2 = Context.CreateObject("Ellipse")
Set GridEllipse3 = Context.CreateObject("Ellipse")
GridEllipse3.AddHandler GridEllipse3.MouseEnterEvent, "GridEllipse3MouseEnter"
GridEllipse1.Width = 30
GridEllipse1.Height = 30
GridEllipse1.Fill = Context.CreateSolidBrush(vbGreen)
GridEllipse2.Width = 30
GridEllipse2.Height = 30
GridEllipse2.Stroke = Context.CreateSolidBrush(vbRed)
GridEllipse3.Width = 30
GridEllipse3.Height = 30
GridEllipse3.Fill = Context.CreateSolidBrush(vbYellow)
Grid1.Children.Add GridEllipse1
Grid1.Children.Add GridEllipse2
Grid1.Children.Add GridEllipse3
Grid1.SetColumn GridEllipse2, 1
Grid1.SetColumn GridEllipse3, 1
Grid1.SetRow GridEllipse3, 1
StackPanel.Children.Add Grid1
Dim Spi As MarkupInputElement
Set Spi = StackPanel
StackPanel.AddHandler Hyperlink.ClickEvent, "HyperClick"
Context.SetHandler Me
Set MarkupLabel1.MarkupUIElement = StackPanel
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.