Modal


Modal - ShowDialog

These must be closed or hidden before continuing.
The FormClosing event will run regardless of the method used to close the form (me.close or corner cross)
If the form is displayed as a modal dialog box (using ShowDialog) clicking X in the upper right corner causes the form to be hidden and the DialogResult property to be set to DialogResult.Cancel.
This can be overridden by setting it to a different value in the FormClosing event.



Dim dlgDialog As New frmDialog() 
If dlgDialog.ShowDialog = System.Windows.Forms.DialogResult.Yes Then

End If

Not Resizeable

this.FormBorderStyle = FormBorderStyle.FixedSingle; 


Closing a Form


this.Dispose 'this is essential when the dialog has been displayed using ShowDialog  
this.Close



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext