Hello, i would like to ask how to make a form in VB circle instead of square.
i know one way, but not how to do it...
by making the things you want transparent purple, but i dont know how to make the purple bits transparent?
Printable View
Hello, i would like to ask how to make a form in VB circle instead of square.
i know one way, but not how to do it...
by making the things you want transparent purple, but i dont know how to make the purple bits transparent?
Check the CreateEllipticRgn API. A quick example, take a silghtly bigger form:Quote:
how to make a form in VB circle
VB Code:
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 Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long Private Sub Form_Load() Dim lX2 As Long, lY2 As Long Dim lRgn As Long lX2 = ScaleX(Form1.Width, vbTwips, vbPixels) 'lY2 = ScaleY(Form1.Height, vbTwips, vbPixels) lRgn = CreateEllipticRgn(0, 0, lX2 \ 2, lX2 \ 2) SetWindowRgn Me.hWnd, lRgn, True End Sub
search for regioning and youll find many examples