Results 1 to 3 of 3

Thread: Change The Layout Of Form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    208

    Change The Layout Of Form

    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?

  2. #2
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Change The Layout Of Form

    how to make a form in VB circle
    Check the CreateEllipticRgn API. A quick example, take a silghtly bigger form:
    VB Code:
    1. Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
    2. Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
    3.  
    4.  
    5. Private Sub Form_Load()
    6.     Dim lX2 As Long, lY2 As Long
    7.     Dim lRgn As Long
    8.    
    9.     lX2 = ScaleX(Form1.Width, vbTwips, vbPixels)
    10.     'lY2 = ScaleY(Form1.Height, vbTwips, vbPixels)
    11.    
    12.     lRgn = CreateEllipticRgn(0, 0, lX2 \ 2, lX2 \ 2)
    13.     SetWindowRgn Me.hWnd, lRgn, True
    14. End Sub
    Show Appreciation. Rate Posts.

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width