563 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
Suppose that whenever you create a form, you always set values for certain properties as follows:
You set the caption of the form when you first create it.
120, 300 or 500, depending on whether the form is tidgy, mediumish or huge.
200, 400 or 700, depending on whether the form is tidgy, mediumish or huge.
What you'd like to be able to do is to write code like the following:
// create a new template form, setting its caption
FormTemplate ft = new FormTemplate("Wise Owl");
ft.size = FormTemplate.FormSize.Tidgy;
When you attach this code to a form button and run it, you'd like it to create and show a form on screen:
Clicking on a button in a test form should run this code to display a new form, with the caption, properties and size requested.
To get started, create a new class called FormTemplate, which should include an enumeration to determine the form size:
public enum FormSize
Your class will need to use the System.Windows.Forms namespace, and should inherit the Form class (so that it will behave like a form, with knobs on).
Add a constructor to your form which takes the form caption as an argument, and within this constructor set the start position, border style and caption.
Add a write-only property called Size which sets the dimensions of the form according to the value of the FormSize enumeration set.
Create the code shown at the start of this exercise to test out your class; running it should bring a form up on screen of the required size and with the required behaviour!
25 Aytoun Street