Exercises
-
To expand on the form events that occur when opening and closing forms, add code to the child1 and child2 forms to display a messages in each of the key events that occur when a form is created and when a form is destroyed.
-
Using the Application class, create a new form that contains a ListBox control and add the following properties to it:
-
CommonAppDataPath
-
CommonAppDataRegistry
-
CompanyName
-
ExecutablePath
-
ProductName
-
ProductVersion
-
StartupPath
-
UserAppDataPath
-
UserAppDataRegistry
Hint: After you add the ListBox control to the form, you need to add code in the Form_Load event using the following syntax:
ListBox1.Items.Add(Application.CommonAppDataPath) ListBox1.Items.Add(Application.StartupPath)
-
- Using the Splitter control, the Panel control, and the knowledge
you have gained about docking today, create an Explorer-style application.
Hint: The Splitter control has a Dock property that dictates whether it should be a horizontal or vertical splitter.
-
Experiment with the TabControl, DateTimePicker, and ErrorProvider controls. Add the controls to a form, and press Ctrl+F1 to view the help files on these controls.
For more information on .NET, visit our .NET Reference Guide or sign up for our .NET Newsletter.