Visual C# | Coding form events exercise | WebBrowser control linked to combobox

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.

Software ==> Visual C#  (79 exercises)
Version ==> Any version of C#
Topic ==> Coding form events  (1 exercise)
Level ==> Harder than average
Subject ==> C# training

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.

The aim of this exercise is to create a his-and-hers website picker to look as follows (for male users, at any rate):

Visual C Sharp 2010 exercise - Coding form events (image 1)

Every male's secret favourite website:

To achieve this, first create a form called frmWebSite and add a ComboBox and WebBrowser control.

Now attach code to the SelectedIndexChanged event of your combobox to make it work.  Here's a suggestion:

Visual C Sharp 2010 exercise - Coding form events (image 2)

We use an IF condition to determine the person's gender, and display a "relevant" URL

That's it!

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post