How to create Circular Controls
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 'Controls - How to create Circular Controls Option Explicit 'Add a Command Button to your Form. 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 Long) As Long Function CircleIt(Contrl As Control) Dim hr&, dl&, usew&, useh& hwndDest = Contrl.hWnd usew& = Contrl.Width / Screen.TwipsPerPixelX useh& = Contrl.Height / Screen.TwipsPerPixelY hr& = CreateEllipticRgn(0, 0, usew&, useh&) dl& = SetWindowRgn(hwndDest, hr, True) End Function 'How can I call this function: Private Sub Command1_Click() 'To Create Circulare Command Button Call CircleIt(Command1) End Sub |
Related posts:
- How to create circular forms
- How to create fancy oval forms
- How to create rounded Form
- How to Dynamically create controls at runtime using Controls.Add and place them in a scrolled window
- How to create form and controls dynamically
- How to create Controls in a form runtime (without creating in design time)
- How to create a email link in your form
- How to create controls at run time
- How to use MouseDown/DoubleClick events for those Controls don’t have it
- How to show your form in different way