Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic Forms 1

Status
Not open for further replies.

hojoho

Technical User
Mar 8, 2003
44
US
I would like to know how to make a form look like an image in vb 6. It is a simple rounded rectangle. Nothing dificult but I have never done this before.
Thanks
 
First, if you want, set the border style to None.

The drop the following two functions into the declaration section of the form:

Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _
ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long


Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long



Then in the form load add the following:

SetWindowRgn hwnd, CreateRoundRectRgn(5, 5, 395, 395, 100, 100), True

You can play around with the values in CreateRoundRectRgn to get different results than my example
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top