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!

Ordinary form to a graphical (cute) one

Status
Not open for further replies.

roswell

Programmer
Mar 18, 2001
26
PH
Does anybody knows how to make a form in vb where I don't want to see the standard one but a different shape of a form like a circle form? Any suggestions are welcome. Thanks.
 
You can use the API function SetWindowRgn.

Here is an example:

Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Private Sub Form_Load()
Dim rgn As Long

rgn = CreateEllipticRgn(0, 0, ScaleWidth \ Screen.TwipsPerPixelX, ScaleHeight \ Screen.TwipsPerPixelY)

SetWindowRgn hWnd, rgn, False
End Sub


The CreateEllipticRgn is also an API function you can replace it with other rgn functions.

Hope this gave you an idea..

If you want some reference about API functions API Guide is i think one of the best.

You can download API Guide in \\http:/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top