Print Page | Close Window

error,please help

Printed From: Codejock Forums
Category: General
Forum Name: XAML Snippets
Forum Description: Post your XAML snippets here for everyone to enjoy :)
URL: http://forum.codejock.com/forum_posts.asp?TID=20237
Printed Date: 03 December 2024 at 12:11pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: error,please help
Posted By: tonywei
Subject: error,please help
Date Posted: 19 October 2012 at 1:49am

Dim context As MarkupContext
Private Sub Form_Load()

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("<WrapPanel><TextBlock>WrapPanelText</TextBlock></WrapPanel>")
StackPanel.Children.Add e
StackPanel.Children.Add context.Parse("<DockPanel><TextBlock>DockPanelText</TextBlock></DockPanel>")
StackPanel.Children.Add context.Parse("<Ellipse Width='10' Height='10' Fill='Red'/>")

StackPanel.Children.Add context.Parse("<Rectangle Width='10' Height='10' Fill='Black' RadiusX='3' RadiusY='4' />")
StackPanel.Children.Add context.Parse("<Line X2='10' Y2='10' Stroke='Black' />")
StackPanel.Children.Add context.Parse("<TextBlock><Rectangle Width='10' Height='10' Fill='Black'/> It was rectangle</TextBlock>")

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

End Sub



i get above code from "online help" in codejock xtreme suite pro.
but i get error "object variable or with block not set"
any suggestion?please help..



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