本文整理匯總了VB.NET中System.Windows.Documents.Hyperlink.Hyperlink構造函數的典型用法代碼示例。如果您正苦於以下問題:VB.NET Hyperlink構造函數的具體用法?VB.NET Hyperlink怎麽用?VB.NET Hyperlink使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在類System.Windows.Documents.Hyperlink
的用法示例。
在下文中一共展示了Hyperlink構造函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Run
' A child Inline element for the new Hyperlink element.
Dim runx As New Run("Link text for the Hyperlink element.")
' After this line executes, the new element "hyper1"
' contains the specified Inline element, "runx".
Dim hyperl As New Hyperlink(runx)
示例2: Run
' A child Inline element for the new Hyperlink element.
Dim runx As New Run("Link text for the Hyperlink element.")
' An empty paragraph will serve as the container for the new Hyperlink element.
Dim parx As New Paragraph()
' After this line executes, the new element "hyperl"
' contains the specified Inline element, "runx". Also, "hyperl" 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 hyperl As New Hyperlink(runx, parx.ContentStart)
示例3: Paragraph
' Create a paragraph and three text runs to serve as example content.
Dim parx As New Paragraph()
Dim run1 As New Run("Text run 1.")
Dim run2 As New Run("Text to link.")
Dim run3 As New Run("Text run 3.")
' Add the three text runs to the paragraph, separated by linebreaks.
parx.Inlines.Add(run1)
parx.Inlines.Add(New LineBreak())
parx.Inlines.Add(run2)
parx.Inlines.Add(New LineBreak())
parx.Inlines.Add(run3)
' After this line executes, the selection of content
' indicated by the "start" and "end" parameters will be
' enclosed by the new Hyperlink. In this case, the new Hyperlink
' will enclose the entire contents of the text run "run2".
Dim hyperl As New Hyperlink(run2.ContentStart, run2.ContentEnd)