Form.Show() is an asynchronous call. Subsequent section of codes will run while the form is being loaded. Form.ShowDialog() is a blocking call - it will block until the form is closed.
In VB.NET, if we access a form directly without creating any instance (e.g. Form.Show()), .NET will automatically create 1 instance of the form for use. Even if the form is not visible, the instance continue to stay in memory until we call Form.Close().
This is not possible in C#, however. In C#, we must explicitly declare an instance of the form:
Form myForm = new Form();
myForm.Show()
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.