button cant draw rectangle vb.net -


i'm trying draw rectangle clicking button, simple thought can't right.

private sub button36_click(byval sender system.object, byval e system.eventargs) handles button36.click     ' create pen.      dim blackpen new pen(color.black, 1)      ' create rectangle.      dim rect new rectangle(10, 710, 35, 100)      ' draw rectangle screen.     me.creategraphics.drawrectangle(blackpen, rect) end sub 

i'm using vb.net

you need of drawing inside paint event.
otherwise, windows erase next time form repaints.

add handler paint event , draw inside using e.graphics.
need keep track of needs painted @ times.


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c++ - CryptStringToBinary API behavior -