I'm new at this.
How come this doesn't work...
Private Sub ColorKeyForm_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint 'Draws diagonal line of dot and dash on form Dim objGraphics As Graphics = Me.CreateGraphics Dim objPen As Pen objPen = New Pen(Drawing.Color.DarkBlue, 3) objPen.DashStyle = Drawing2D.DashStyle.DashDot objGraphics.DrawLine(objPen, 20, 20, 400, 400) 'Next routine does nothing Dim objPicGraphics As Graphics = picColorKey.CreateGraphics objPen = New Pen(Drawing.Color.Chartreuse, 5) objPen.DashStyle = Drawing2D.DashStyle.Dot objPicGraphics.DrawLine(objPen, 20, 20, 400, 400) End Sub
... the top part draws a line on the form but the second part does nothing. The picColorKey is a picture box on the form.