本文整理汇总了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