1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Accessのフォームを解像度に合わせてサイズ変更する方法

Posted at
Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

' 画面の幅と高さを取得するための定数
Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1
'フォームのサイズを調整する次に、フォームのLoadイベントまたはOpenイベント内で、以下のようなコードを使用してフォームのサイズを調整します。
Private Sub Form_Load()
    Dim screenWidth As Long
    Dim screenHeight As Long
    
    ' 画面の解像度を取得
    screenWidth = GetSystemMetrics32(SM_CXSCREEN)
    screenHeight = GetSystemMetrics32(SM_CYSCREEN)
    
    ' フォームのサイズを画面解像度に合わせて調整
    Me.Move 0, 0, screenWidth, screenHeight
End Sub
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?