本文整理匯總了VB.NET中System.Windows.Controls.Viewbox.Child屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET Viewbox.Child屬性的具體用法?VB.NET Viewbox.Child怎麽用?VB.NET Viewbox.Child使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Controls.Viewbox
的用法示例。
在下文中一共展示了Viewbox.Child屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Viewbox
' Create a ViewBox and add it to the Canvas
Dim myViewbox As New Viewbox()
myViewbox.StretchDirection = StretchDirection.Both
myViewbox.Stretch = Stretch.Fill
myViewbox.MaxWidth = 400
myViewbox.MaxHeight = 400
' Create a new Grid that is hosted in the Viewbox
Dim myGrid As New Grid()
' Create an Ellipse that is also hosted in the Grid
Dim myEllipse As New Ellipse()
myEllipse.Stroke = Brushes.RoyalBlue
myEllipse.Fill = Brushes.LightBlue
' Create a TextBlock that is also hosted in the Grid
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Viewbox"
' Add the children to the Grid
myGrid.Children.Add(myEllipse)
myGrid.Children.Add(myTextBlock)
' Add the Grid as the single child of the Viewbox
myViewbox.Child = myGrid
'Position the Viewbox in the Parent Canvas
Canvas.SetTop(myViewbox, 100)
Canvas.SetLeft(myViewbox, 100)
myCanvas.Children.Add(myViewbox)