How to create rounded Form
Posted on September 4, 2009
Sometimes we may need to create a form little differently like rounded form. Here is the way to set your form as rounded:
Instructions:
- Create a new Project
- Add a new Form to it and name it as Form1
- Add a new command button to it and name it as Command1
- Add a new Module to it and name it as Module1
Now, add the following code to Module1:
1 2 3 4 | Option Explicit Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long |
Add the following code to Form1:
1 2 3 4 5 6 7 8 9 | Option Explicit Private Sub Command1_Click() Unload Me End Sub Private Sub Form_Load() SetWindowRgn hWnd, CreateEllipticRgn(0, 0, 300, 200), True End Sub |
Related posts:
- How to create fancy oval forms
- How to create circular forms
- How to create Circular Controls
- How to show your form in different way
- How to Confine a Form to another Form
- How to Create a Menu completely at Runtime
- How to add Horizontal ScrollBar to list box control using API
- How to draw Rounded PolyGon
- How to create a splash screen.
- How to Make Controls and Forms with your own Custom Shape