or
Private Shadows Sub ExtendedPaint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint | |
If Not String.IsNullOrEmpty(Me._alt_text) Then '_alt_text (string property) | |
Dim f1 As Font = New Font("Arial", 8.0F, FontStyle.Bold) | |
Dim sf As New StringFormat() | |
Dim brush As System.Drawing.Brush = New SolidBrush(Me._alt_text_color) | |
Dim rect As Rectangle = New Rectangle(e.ClipRectangle.X, e.ClipRectangle.Y, e.ClipRectangle.Width, e.ClipRectangle.Height - 7) | |
sf.Alignment = StringAlignment.Center | |
sf.LineAlignment = StringAlignment.Far | |
e.Graphics.DrawString(Me._alt_text, f1, brush, rect, sf) | |
brush.Dispose() | |
sf.Dispose() | |
f1.Dispose() | |
End If | |
End Sub |