円形のフォーム: Access




BackHome BackTips Backメニュー

■ Access VBA 実行コード

'ウィンドウズAPI
'指定されたウィンドウのリージョンを設定します
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 CreatePolygonRgn Lib "gdi32" _
    (lpPoints As Any, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long

'コマンドクリックイベント
Private Sub コマンド0_Click()
    Dim lRet As Long

'戻り値はリージョンのハンドル
    lRet = CreateEllipticRgn(50, 50, 300, 300)
    lRet = SetWindowRgn(Me.hWnd, lRet, True)

End Sub

BackHome BackTips Backメニュー

Copyright(C) FeedSoft