Visual C# | Creating forms exercise | Create a DateTimePicker and 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 ==> Creating forms  (4 exercises)
Level ==> Average difficulty
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 an application form for a dating agency.  Create a form alled frmApplicationForm and add controls and formatting so that it looks something like this:

Visual C Sharp 2010 exercise - Creating forms (image 1)

You can choose different colours ...

Your form should include:

  • a ComboBox control (you can use the SelectedItem.Text property of the combobox to find out the user's preference); and
  • a DateTimePicker control (see hint below)

You can use something like dtpDateOfBirth.Value.ToString("dd/MM/yyyy") to get at the date entered.

When a user clicks on Apply now, they should see something like this in a message box:

Visual C Sharp 2010 exercise - Creating forms (image 2)

You should create and display a string of text containing the user's choices

When you're happy that your form works successfully, close it down.

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