本文介绍了如何知道是否在vb.net中单击了“关闭"按钮(在标题栏中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,每个人我仍然不知道如何知道在Visual Studio 2008中是否单击了关闭按钮,它的事件名称是什么,我该怎么做.

请我需要您的帮助
谢谢.

hey every body i still don''t understand how to know whether the close button is clicked or not in visual studio 2008 and what is its event name and how do i do it.

please i need ur help
Thanks.

推荐答案

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If boolCloseByButton Then
           'Closed by a different button           
        Else
           'Closed by the x on the form
        End If
End Sub



希望对您有帮助



Hope this helps


Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing  
    'You could put a Select Case statement here and take action for all
    'different types of closing conditions.      
    If e.CloseReason = System.Windows.Forms.CloseReason.UserClosing Then 
          'Closed by the x on the form or Alt-F4
    Else    
          'Closed for some other reason       
               
    End If

End Sub


这篇关于如何知道是否在vb.net中单击了“关闭"按钮(在标题栏中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 20:30