Imports System.Drawing Imports System.Drawing.Drawing2D Public Class Gauge Dim i As Integer Public WriteOnly Property angle() As Integer Set(ByVal value As Integer) i = value Me.Invalidate() End Set End Property Private Sub Gauge_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint 'A rectangle to hold the needle graphic. The graphic used here is 161 x 161 pixels '-81,-81 is the offset that centers this particular image (161/2) Dim _rect As New Rectangle(-81, -81, 1, 1) ' Needle scale factor .5 = 1/2 size , 2 = size x 2 etc e.Graphics.ScaleTransform(1, 1, MatrixOrder.Append) ' Save the state. Dim graphics_state As GraphicsState = e.Graphics.Save() ' Translate to center on the form. Adjust height/width to reposition. e.Graphics.TranslateTransform(Me.Width \ 2, Me.Height \ 2, MatrixOrder.Append) ' Rotate i degrees. e.Graphics.RotateTransform(i, MatrixOrder.Prepend) 'Draw the needle in the rectangle e.Graphics.DrawImageUnscaled(My.Resources.Myneedle, _rect) ' Restore the saved state. e.Graphics.Restore(graphics_state) e.Graphics.Restore(graphics_state) End Sub End Class