Önce bir commandbutton oluşturun
Ve formun borderstyle
Ardından bu kodu kullanın
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()
On
Error
Resume
Next
a = 0
Do
Until
Form1.Height < 300
b = (Form1.Height * Form1.Width) / 1000000
a = a + b
Form1.Top = Form1.Top + a / 2
Form1.Left = Form1.Left + a / 2
Form1.Height = Form1.Height - a
Form1.Width = Form1.Width - a
Dim
hr&, dl&
Dim
usew&, useh&
usew& =
Me
.Width / Screen.TwipsPerPixelX
useh& =
Me
.Height / Screen.TwipsPerPixelY
hr& = CreateEllipticRgn(0, 0, usew, useh)
dl& = SetWindowRgn(
Me
.hWnd, hr,
True
)
DoEvents
Loop
Unload
Me
End
Sub