Ok, i thought the last two pieces of code in post 4 were for a different way of doing it. Misunderstanding. There in now, in the class. All the errors are gone apart from this one
Error 1 Overload resolution failed because no accessible 'New' accepts this number of arguments.
This is referring to line 11 of the code posted below.
Ive added comments in so you can see how right/wrong i may be about what im doing
vb.net Code:
'Mouse down event triggers the sub
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
'Define drawobj as a new instance of the class/sub "drawobject" with () for input of mouse coords
Dim drawObj As DrawObject = New DrawObject()
'set size/location property of the new object as mouse coord x -3, y - 3, & height 5, width 5
drawObj.Bounds = New DrawObject(e.X - 3, e.Y - 3, 5, 5)
'then conditions for the radio buttons
If crsrO.Checked Then
drawObj.Shape = DrawObject.Shapes.Cross
drawObj.Color = Color.Blue
Else
drawObj.Shape = DrawObject.Shapes.Ellipse
drawObj.Color = Color.Red
End If
'dont get this bit, but i think it might be adding the object just drawn to the pic box,
drawobjects.Add(drawObj)
'this as you said redraws it immediately so we can see it straight away
PictureBox1.Invalidate()
End Sub
End Class
how wrong am i?
Now you said previously that all the rectangle references should be changed to drawobject, well there are "rectangle" reference still written down in a few places but i think it should be there.
There is one instance of it in the picturebox_paint sub
all the rest are in the class Drawobject which you created
Should they all be there?