掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
フォームの幅と高さを調節するには? (ID:79974)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
下のコードを貼り付けて実行してみて下さい。 雰囲気的なものは分かると思います。 '* Form1 ****************************************************** Private Sub Form_Click() myMsgBox "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" myMsgBox "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf & _ "A" & vbCrLf End Sub '* Form2 ****************************************************** ' Label1, Command1, Command2 をフォーム上に Public wButton As VbMsgBoxResult Private Sub Command1_Click() wButton = vbOK Unload Me End Sub Private Sub Command2_Click() wButton = vbCancel Unload Me End Sub '* Module1 **************************************************** Public Function myMsgBox(Prompt, _ Optional Buttons As VbMsgBoxStyle = vbOKOnly, _ Optional Title, _ Optional HelpFile, _ Optional Context) As VbMsgBoxResult Dim oMsgBox As Form2 Set oMsgBox = New Form2 With oMsgBox .Label1.AutoSize = True .Label1.Caption = CStr(Prompt) .Width = .Label1.Left + .Label1.Width + 3000 .Height = .Label1.Top + .Label1.Height + 3000 End With oMsgBox.Show vbModal myMsgBox = oMsgBox.wButton Set oMsgBox = Nothing End Function
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.