مرحبا : هذا كود بسيط لجعل الفورم بشكل بيضوي :
Option Explicit
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 Long) As Long
Private Sub Command1_Click()
MsgBox "Button Pressed"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
ChangeShape Me
ChangeShape Text1
ChangeShape Check1
ChangeShape Command1
ChangeShape Option1
ChangeShape Option2
ChangeShape Picture1
End Sub
Private Sub ChangeShape(po_Control As Object)
Dim ll_Width As Long
Dim ll_Height As Long
Dim ll_Left As Long
Dim ll_Top As Long
Dim ll_Region As Long
With po_Control
ll_Width = .Width / Screen.TwipsPerPixelX
ll_Height = .Height / Screen.TwipsPerPixelY
End With
ll_Region = CreateEllipticRgn(0, 0, ll_Width, ll_Height)
Call SetWindowRgn(po_Control.hWnd, ll_Region, True)
End Sub
الى اللقاء