![]() Furthermore, Closing can be used to prevent a window from closing. ' If user doesn't want to close, cancel closureĬlosing can be handled to detect when a window is being closed (for example, when Close is called). Close without saving?"ĭim result As MessageBoxResult = MessageBox.Show(msg, "Data App", MessageBoxButton.YesNo, MessageBoxImage.Warning) ' If data is dirty, notify user and ask for a responseĭim msg As String = "Data is dirty. Private Sub DataWindow_Closing(ByVal sender As Object, ByVal e As CancelEventArgs) Private Sub documentTextBox_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Imports System.ComponentModel ' CancelEventArgs ![]() ![]() If user doesn't want to close, cancel closure If data is dirty, notify user and ask for a response Void DataWindow_Closing(object sender, CancelEventArgs e) Void documentTextBox_TextChanged(object sender, EventArgs e) Using System.ComponentModel // CancelEventArgs The following example demonstrates a Window that determines whether it needs user intervention to close. ![]() Visibility is set, or Show(), ShowDialog(), or Close() is called while a window is closing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |