본문 바로가기

DEV/VB

VisualBasic 폼을 원으로 만들기

반응형
' 선언부

' ### 폼 원형으로 설정
Private Declare Function CreateEllipticRgn Lib "gdi32.dll" ( _
    ByVal X1 As Long, _
    ByVal Y1 As Long, _
    ByVal X2 As Long, _
    ByVal Y2 As Long _
) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" ( _
    ByVal hWnd As Long, _
    ByVal hRgn As Long, _
    ByVal bRedraw As Boolean _
) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" ( _
    ByVal hObject As Long _
) As Long

' 사용시

' ### 폼을 둥글게 설정한다.
Dim hRgn As Long
hRgn = CreateEllipticRgn(0, 0, ScaleX(Me.Width, vbTwips, vbPixels), ScaleY(Me.Height, vbTwips, vbPixels))
SetWindowRgn hWnd, hRgn, False
DeleteObject hRgn
반응형
댓글