1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub ToolTip_Draw(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawToolTipEventArgs) Handles ToolTip1.Draw
' Draw the standard background.
e.Graphics.FillRectangle(Brushes.LemonChiffon, e.Bounds)
' Draw the custom border to appear 3-dimensional.
e.Graphics.DrawLines( _
SystemPens.ControlLightLight, New Point() { _
New Point(0, e.Bounds.Height - 1), _
New Point(0, 0), _
New Point(e.Bounds.Width - 1, 0)})
e.Graphics.DrawLines( _
SystemPens.ControlDarkDark, New Point() { _
New Point(0, e.Bounds.Height - 1), _
New Point(e.Bounds.Width - 1, e.Bounds.Height - 1), _
New Point(e.Bounds.Width - 1, 0)})
'Specify custom text formatting flags.
Dim sf As TextFormatFlags = TextFormatFlags.VerticalCenter Or _
TextFormatFlags.HorizontalCenter Or _
TextFormatFlags.NoFullWidthCharacterBreak
' Draw standard text with customized formatting options.
e.DrawText(sf)
End Sub |
Partager