Kalau biasanya kita membuat sebuah form dalam visual basic berbentuk kotak, berikut adalah sebuah tip / trik membuat form berbentuk elips.
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 Form_Load()
Dim lngRegion as Long
Dim lngReturn as Long
Dim lngFormWidth as Long
Dim lngFormHeight as Long
lngFormWidth = Me.Width / Screen.TwipsPerPixelX
lngFormHeight = Me.Height / Screen.TwipsPerPixelY
lngRegion createellipticrgn(0,0,lngformwidth,lngformheight)
lngreturn=setwindowrgn(me.hwnd,lngregion,true)
end sub
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar