本文整理汇总了VB.NET中System.Windows.Forms.DrawListViewColumnHeaderEventArgs.DrawBackground方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DrawListViewColumnHeaderEventArgs.DrawBackground方法的具体用法?VB.NET DrawListViewColumnHeaderEventArgs.DrawBackground怎么用?VB.NET DrawListViewColumnHeaderEventArgs.DrawBackground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DrawListViewColumnHeaderEventArgs
的用法示例。
在下文中一共展示了DrawListViewColumnHeaderEventArgs.DrawBackground方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: StringFormat
' Draws column headers.
Private Sub listView1_DrawColumnHeader(ByVal sender As Object, _
ByVal e As DrawListViewColumnHeaderEventArgs) _
Handles listView1.DrawColumnHeader
Dim sf As New StringFormat()
Try
' Store the column text alignment, letting it default
' to Left if it has not been set to Center or Right.
Select Case e.Header.TextAlign
Case HorizontalAlignment.Center
sf.Alignment = StringAlignment.Center
Case HorizontalAlignment.Right
sf.Alignment = StringAlignment.Far
End Select
' Draw the standard header background.
e.DrawBackground()
' Draw the header text.
Dim headerFont As New Font("Helvetica", 10, FontStyle.Bold)
Try
e.Graphics.DrawString(e.Header.Text, headerFont, _
Brushes.Black, e.Bounds, sf)
Finally
headerFont.Dispose()
End Try
Finally
sf.Dispose()
End Try
End Sub
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms,代码行数:34,代码来源:DrawListViewColumnHeaderEventArgs.DrawBackground