If you take a close look at some c# code, you will see that it can generally be converted to VB pretty easily. Knowing a little C++ (or C#) will help alot.
[VB]
//C#
public class Line
{
public Point StartPoint;
public Point EndPoint;
public int PenWidth;
public void DrawLine(Graphics g,Color c)
{
Pen p=new Pen(c,PenWidth);
g.DrawLine(p,StartPoint,EndPoint);
p.Dispose();
}
}
VB
Public Class Line
Public StartPoint As Point
Public EndPoint As Point
Public PenWidth As Integer
Public Sub DrawLine(ByVal g As Graphics, ByVal c As Color)
Dim p As New Pen(c, PenWidth)
g.DrawLine(p, StartPoint, EndPoint)
p.Dispose()
End Sub
End Class
[/VB]
[VB]
//C#
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
foreach(Line l in Lines)
l.DrawLine(e.Graphics,Color.Black);
}
VB
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
For Each l As Line In Lines
l.DrawLine(e.Graphics, Color.Black)
Next
End Sub
[/VB]
Im not going to translate everything, not to be difficult, but because I dont have time and that isnt what these forums are for. Maybe someone else feels like being nicer.