|
-
Jul 14th, 2005, 12:30 PM
#1
Thread Starter
Fanatic Member
custom function doesn't work, but gieves no error...
Hi! Now that I got all the details straight, I can attack the main feature of the software I'm designing. I want to draw a rectangle on the "main" form, when a button is clicked on the frm. I have this function in a module:
VB Code:
Public Function drawDesignArea()
Dim myGraphics As Graphics
Dim myRectangle As Rectangle
Dim myPen As New Pen(Color.Red)
main.Height = 100
myGraphics = Graphics.FromHwnd(hwnd:=main.Handle)
myRectangle = New Rectangle(x:=5, y:=5, Width:=10, Height:=40)
myGraphics.DrawRectangle(Pen:=myPen, rect:=myRectangle)
End Function
and I call it when the button on the "wizard" form is pressed. But nothing happens. The rectangle doesnt draw, neither does the form resize to height =100... The "main" form is the drawing surface, but I need some setting (i.e. the size of the rectangle to draw, and other settings), and I'm using a wizard for this. Thats why I want to call the function from another form where it is meant to draw. I hope I made myself clear. Thank you in advance!¸
Jean Christophe Avard
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|