本文整理匯總了VB.NET中System.Drawing.StringFormat.ToString方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET StringFormat.ToString方法的具體用法?VB.NET StringFormat.ToString怎麽用?VB.NET StringFormat.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了StringFormat.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: ToStringExample
Public Sub ToStringExample(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("Times New Roman", 14)
Dim myStringFormat As New StringFormat
' String variable to hold the values of the StringFormat object.
Dim strFmtString As String
' Convert the string format object to a string (only certain
' information in the object is converted) and display the string.
strFmtString = myStringFormat.ToString()
g.DrawString("Before changing properties: ", myFont, blueBrush, _
20, 40, myStringFormat)
' Change some properties of the string format.
myStringFormat.Trimming = StringTrimming.None
myStringFormat.FormatFlags = StringFormatFlags.NoWrap Or _
StringFormatFlags.NoClip
' Convert the string format object to a string and display the
' string. The string will be different because the properties of
' the string format have changed.
strFmtString = myStringFormat.ToString()
g.DrawString("After changing properties: ", myFont, blueBrush, _
20, 70, myStringFormat)
End Sub