what this exeption for (Parameter is not valid)
my code to draw line is
Imports System.Drawing Imports System.Drawing.Drawing2D Imports System.Drawing.Imaging Imports System.Drawing.Text Public Class Form1 Public myPen As New Pen(Color.Azure, 15) Public x1, y1, x2, y2 As Integer Public gr As Graphics Public Sub Form1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint gr = e.Graphics gr.DrawLine(myPen, x1, y1, x2, y2) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load myPen.DashStyle = DashStyle.DashDot End Sub Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As _ System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown x1 = e.X : y1 = e.Y End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As _ System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp x2 = e.X : y2 = e.Y gr.DrawLine(myPen, x1, y1, x2, y2) End Sub End Class
