您好,亲爱的我需要帮助,我想禁用vb.net表单关闭按钮,并希望从按钮关闭
Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Form2.Show()
If Form2.Visible = True Then
e.Cancel = False
End If
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class
答案 0 :(得分:1)
您可以像关闭它一样
Me.ControlBox = False
如果您想关闭某物
Me.Close()
希望这会有所帮助!