Animasi Form Bulat Dengan VB6.0
1. Buatlah Sebuah Form :

2.
Buatlah Sebuah Modul:
Public Declare
Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As
Long, ByVal bRedraw As Boolean) As Long
Public Declare
Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As
Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare
Function ExitWindowsEx Lib "user32" (ByVal _
uFlags As Long,
ByVal dwReserved As Long) As Long
3.
Masukkan Listing Dibawah Ini Pada Form:
Private Sub Form_Load()
Dim atas As Long
Dim hasil As Long
Me.Width = 1000 *
Screen.TwipsPerPixelX / 2
Me.Height = 1000 *
Screen.TwipsPerPixelY / 2
atas = CreateEllipticRgn&(10,
50, 450, 470)
hasil = SetWindowRgn(Me.hwnd, atas,
True)
End Sub
Private Sub Form_Paint()
Dim y As Long
Dim tinggi As Long
Dim lebar As Long
ScaleMode = vbPixels
tinggi = ScaleHeight
lebar = ScaleWidth
DrawStyle = vbInvisible
FillStyle = vbFSSolid
For y = 0 To tinggi
FillColor = RGB(0, 0, 255 - (y *
255) \ tinggi)
Line (-1, y - 1)-(lebar, y + 1), ,
B
Next y
End Sub
4.
Jalankan
program dan lihatlah hasil seperti dibawah ini:

Untuk lebih jelas anda bisa buka modulnya atau bisa download langsung projectnya disini
Komentar
Posting Komentar
Tulis komentar anda disini.....