本文整理汇总了VB.NET中System.Windows.Documents.Span.Span构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET Span构造函数的具体用法?VB.NET Span怎么用?VB.NET Span使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了Span构造函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: Run
' A child Inline element for the new Span element.
Dim runx1 As New Run("The Run element derives from Inline, and is therefore" & "an acceptable child element for this new Span.")
' After this line executes, the new element "spanx"
' contains the specified Inline element, "runx".
Dim spanx1 As New Span(runx1)
开发者ID:VB.NET开发者,项目名称:System.Windows.Documents,代码行数:6,代码来源:Span
示例2: Run
' A child Inline element for the new Span element.
Dim runx2 As New Run("The Run element derives from Inline, and is therefore" & "an acceptable child element for this new Span.")
' An empty paragraph will serve as the container for the new Span element.
Dim parx2 As New Paragraph()
' After this line executes, the new element "spanx"
' contains the specified Inline element, "runx". Also, "spanx" is
' inserted at the point indicated by the insertionPosition parameter,
' which in this case indicates the content start position in the Paragraph
' element "parx".
Dim spanx2 As New Span(runx2, parx2.ContentStart)
开发者ID:VB.NET开发者,项目名称:System.Windows.Documents,代码行数:12,代码来源:Span
示例3: Paragraph
' Create a paragraph and three text runs to serve as example content.
Dim parx3 As New Paragraph()
Dim run1 As New Run("Text run 1.")
Dim run2 As New Run("Text run 2.")
Dim run3 As New Run("Text run 3.")
' Add the three text runs to the paragraph, separated by linebreaks.
parx3.Inlines.Add(run1)
parx3.Inlines.Add(New LineBreak())
parx3.Inlines.Add(run2)
parx3.Inlines.Add(New LineBreak())
parx3.Inlines.Add(run3)
' After this line executes, the selection of content
' indicated by the "start" and "end" parameters will be
' enclosed by the new Span. In this case, the new Span
' will enclose the entire contents of the Paragraph "parx",
' which happens to contain three text runs and two linebreaks.
Dim spanx As New Span(parx3.ContentStart, parx3.ContentEnd)
' Now, properties set on "spanx" will override default properties
' on elements contained by "spanx". For example, setting
' these arbitrary display properties on "spanx" will affect
' the child text runs enclosed by "spanx".
spanx.Foreground = Brushes.Blue
spanx.Background = Brushes.GhostWhite
spanx.FontFamily = New FontFamily("Century Gothic")
' Non-default property values override any settings on the
' enclosing Span element.
run2.Foreground = Brushes.Red
run2.Background = Brushes.AntiqueWhite
run2.FontFamily = New FontFamily("Lucida Handwriting")
开发者ID:VB.NET开发者,项目名称:System.Windows.Documents,代码行数:33,代码来源:Span
注:本文中的System.Windows.Documents.Span.Span构造函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论