WISE OWL EXERCISES
WPF - VISUAL C# EXERCISES
WPF - Visual C# | Menus and toolbars exercise | Create menus and a toolbar to change a gradient brush
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.
The answer to the exercise will be included and explained if you attend the relevant Wise Owl course (sadly, only in the UK for now).
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Create a window called winMenus, and create as many of the following components as you have time for!
The first menu gives you a choice of colours for the first linear gradient stop (you might want to leave making the checking of menu items mutually exclusive until the end, as this is tricky).
See below for how the second menu works.
The second menu works in exactly the same way:
Here we've chosen a red colour for the second half of the linear gradient brush.
Still bored? Why not add the toolbar using the icons in the folder at the top of this exercise:
If you click on a tool, it makes every gradient stop the same colour.
Still bored? You could add a right-mouse button menu (context menu) for the rectangle (this isn't, however, included in the answer - you may not be bored ...).