I am trying to access MDB data with a datagrid in VB Express. I have a datagrid called design and am trying to use values from the grid columns to draw lines in the picturebox.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Draw.Click
Dim bit As Bitmap = New Bitmap(Picturebox1.Width, Picturebox1.Height)
Dim g As Graphics = Graphics.FromImage(bit)
Dim myPen As Pen = New Pen(Color.White, 0.5)
Dim design As DataGridView
Dim H, W, D, L, B, T 'dimensions and locations from grid Design
Dim M As Integer
W = design(1, 1)
D = design(1, 1)
M = 20
g.DrawLine(myPen, 0, 5, Picturebox1.Width, Picturebox1.Height)
g.DrawLine(myPen, M, M + H, M + W, M + H)
Picturebox1.Image = bit
But this does not work. Help please...