本文整理匯總了VB.NET中System.Drawing.StringFormat.SetDigitSubstitution方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET StringFormat.SetDigitSubstitution方法的具體用法?VB.NET StringFormat.SetDigitSubstitution怎麽用?VB.NET StringFormat.SetDigitSubstitution使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了StringFormat.SetDigitSubstitution方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: SetDigitSubExample
Public Sub SetDigitSubExample(ByVal e As PaintEventArgs)
Dim g As Graphics = e.Graphics
Dim blueBrush As New SolidBrush(Color.FromArgb(255, 0, 0, 255))
Dim myFont As New Font("Courier New", 12)
Dim myStringFormat As New StringFormat
Dim myString As String = "0 1 2 3 4 5 6 7 8 9"
' Arabic (0x0C01) digits.
' Use National substitution method.
myStringFormat.SetDigitSubstitution(&HC01, _
StringDigitSubstitute.National)
g.DrawString("Arabic:" & ControlChars.Cr & _
"Method of substitution = National: " & myString, _
myFont, blueBrush, New PointF(10.0F, 20.0F), myStringFormat)
' Use Traditional substitution method.
myStringFormat.SetDigitSubstitution(&HC01, _
StringDigitSubstitute.Traditional)
g.DrawString("Method of substitution = Traditional: " _
& myString, myFont, blueBrush, New PointF(10.0F, 55.0F), _
myStringFormat)
' Thai (0x041E) digits.
' Use National substitution method.
myStringFormat.SetDigitSubstitution(&H41E, _
StringDigitSubstitute.National)
g.DrawString("Thai:" & ControlChars.Cr & _
"Method of substitution = National: " & myString, _
myFont, blueBrush, New PointF(10.0F, 85.0F), myStringFormat)
' Use Traditional substitution method.
myStringFormat.SetDigitSubstitution(&H41E, _
StringDigitSubstitute.Traditional)
g.DrawString("Method of substitution = Traditional: " _
& myString, myFont, blueBrush, New PointF(10.0F, 120.0F), _
myStringFormat)
End Sub