Hi
How do you draw GDI+ graphics within a class? In my normal starting form, I use the form_paint event but the seperate class doesn't seem to accept the _paint event. So I instead put my gaphics code in the same area as my second classes form propertoes.
Class SenateTown
Dim SenateTown as new form
Dim g as graphics
Public img as new bitmap("PC.bmp")
Public Function FormProperties
SenateTown.enabled = true
SenateTown.visible = true
SenateTown.Height = 600
SenateTown.Width = 600
g.drawgraphics(img, 0, 0)
End Function
But when I try this, it comes up with an error message saying "object reference not set to an instance of an object." I think I understand what it means. It sounds as if its stating that I haven't set the graphics to draw on a particular form, as I have two, but I don't know how to tell it to draw on a particuliar form. instead of g.drawimage... I tried me.g.drawimage... but that came up with the same result.
Thankyou