投稿日 | : 2003/05/07(Wed) 13:24 |
投稿者 | : NAO★ |
Eメール | : |
URL | : |
タイトル | : Re: formのcloseについて |
Dim flag As Boolean = False ' エラーになったら True
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
flag = True
End Sub
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
' Call the OnPaint method of the base class.
MyBase.OnPaint(e)
If (flag = True) Then
Me.Close()
End If
End Sub
Loadイベントではフラグだけ立てて置いて、OnPaintイベントでCloseしています。
一瞬表示されますけど、安全かな?