R
Ranjit
Please tell me why the line is not been displayed on my
form.This code of mine contains absolutely no errors but
the lines are not being displayed on my form.Here is my
coding.I'm actually forced to put this in newsgroup since
I'm the only person who knows atleast a bit about VB.net
in my company and many of my friends dont know VB.net.So
I'm helpless.Here's my coding :
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
On Error Resume Next
For i = 0 To rs.RecordCount
x1 = Val(CStr(rs.Fields("Easting").Value))
y1 = Val(CStr(rs.Fields("Northing").Value))
Dim pt As Point = New Point(x1, y1)
Dim pt2 As Point = New Point(x2, y2)
e.Graphics.DrawLine(Pens.Green, myconversion
(pt), myconversion(pt2))
rs.MoveNext()
x2 = Val(CStr(rs.Fields("Easting").Value))
y2 = Val(CStr(rs.Fields("Northing").Value))
e.Graphics.DrawLine(Pens.Green, myconversion
(pt), myconversion(pt2))
Next
rs.Close()
End Sub
Private Function myconversion(ByVal temp As Point) As
Point
Return New Point(temp.X, Me.ClientSize.Height -
temp.Y)
End Function
It contains no error but the lines are not been shown and
I did connect it to my Access database properly.There are
about atleast 120 records in my Access database.
Thanking You,
Ranjit
form.This code of mine contains absolutely no errors but
the lines are not being displayed on my form.Here is my
coding.I'm actually forced to put this in newsgroup since
I'm the only person who knows atleast a bit about VB.net
in my company and many of my friends dont know VB.net.So
I'm helpless.Here's my coding :
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
On Error Resume Next
For i = 0 To rs.RecordCount
x1 = Val(CStr(rs.Fields("Easting").Value))
y1 = Val(CStr(rs.Fields("Northing").Value))
Dim pt As Point = New Point(x1, y1)
Dim pt2 As Point = New Point(x2, y2)
e.Graphics.DrawLine(Pens.Green, myconversion
(pt), myconversion(pt2))
rs.MoveNext()
x2 = Val(CStr(rs.Fields("Easting").Value))
y2 = Val(CStr(rs.Fields("Northing").Value))
e.Graphics.DrawLine(Pens.Green, myconversion
(pt), myconversion(pt2))
Next
rs.Close()
End Sub
Private Function myconversion(ByVal temp As Point) As
Point
Return New Point(temp.X, Me.ClientSize.Height -
temp.Y)
End Function
It contains no error but the lines are not been shown and
I did connect it to my Access database properly.There are
about atleast 120 records in my Access database.
Thanking You,
Ranjit