Free Visual Basic exercises

This page lists 46 Visual Basic exercises. You can use the menu on the left to show just exercises for a specific topic.

This page lists 46 Visual Basic exercises. You can use the menu above to show just exercises for a specific topic.

Software: Visual Basic
Version: Any version of VB
Topic: Form validation
Level: Relatively easy
Course:
Exercise: Using a NumericUpDown control to check that an age is filled in correctly.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Testing conditions
Level: Relatively easy
Course:
Exercise: Check that two combo boxes on a form have been filled in.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Drawing forms
Level: Relatively easy
Course:
Exercise: Design a form to display the star sign and characteristics of a person, using toolboxes and buttons.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating classes
Level: Relatively easy
Course:
Exercise: Write a ShoppingList class in VB to get a shopping application to work.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Basic DataGridViews
Level: Relatively easy
Course:
Exercise: Create a formatted DataGridView, displaying mortgage types from an Access database.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Enumerations and constants
Level: Relatively easy
Course:
Exercise: Create an enumeration in Visual Basic to see what age band someone falls into.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating classes
Level: Relatively easy
Course:
Exercise: Create a class in VB to hold items in a shopping list.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Passing arguments
Level: Relatively easy
Course:
Exercise: Use a subroutine with arguments to display different messages.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Lists
Level: Relatively easy
Course:
Exercise: Create and populate an array of the first 10 square numbers.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Variables and constants
Level: Relatively easy
Course:
Exercise: Use variables to determine the length of text typed into a form.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Loops
Level: Relatively easy
Course:
Exercise: Find the longest entry in a combo box's rows, by looping in VB.NET.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Coding in VB.NET
Level: Relatively easy
Course:
Exercise: Create a basic VB program to display the choices made in a form.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Form validation
Level: Relatively easy
Course:
Exercise: Test your form validation skills - validate the name and age of a dating agency applicant.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Working with files
Level: Relatively easy
Course:
Exercise: Create code to write out form entries using a streamwriter to a text file.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating properties
Level: Relatively easy
Course:
Exercise: Create properties for a dating agency application form to make it work.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Variables and constants
Level: Average difficulty
Course:
Exercise: Create code to count the number of times someone clicks on a button.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Using arrays
Level: Average difficulty
Course:
Exercise: Create an array based on values typed into a form.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Passing arguments
Level: Average difficulty
Course:
Exercise: Use a VB.NET function to work out someone's BMI from entered data.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Reacting to DataGridView events
Level: Average difficulty
Course:
Exercise: Add validation code to a form showing mortgage applicants so that an invalid entry causes an error message to pop up.

Go to exercise ...

Software: Visual Basic
Version:
Topic: Menus and toolbars
Level: Average difficulty
Course:
Exercise: Creating a menustrip, toolstrip, statusstrip and contextmenu for a simple pen colour application, and writing efficient code to make them work.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Reacting to DataGridView events
Level: Average difficulty
Course:
Exercise: Attach code to the UserDeletingRow event of a DataGridView to show a confirmation message before deleting a row.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Drawing forms
Level: Average difficulty
Course:
Exercise: Draw a form allowing a dating agency candidate to enter their name and date of birth, and choose their sexuality from a drop list.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Coding in VB.NET
Level: Average difficulty
Course:
Exercise: Use MessageBox.Show to display the title and message typed into a form.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Form validation
Level: Average difficulty
Course:
Exercise: Add ErrorProvider controls to a form to validate the age a person types in.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Lists
Level: Average difficulty
Course:
Exercise: Generate a list of Friday 13th dates, and display these in a listbox.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Menus and toolbars
Level: Average difficulty
Course:
Exercise: Code an application to allow you to change text box colours, including a menu, toolbar and short-cut menus.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Reacting to DataGridView events
Level: Average difficulty
Course:
Exercise: Create a DataGridView with conditional formatting and default values for new rows, using DataGridView event code for each.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Files and folders
Level: Average difficulty
Course:
Exercise: Display a file dialog box to choose files to search, then open each using a streamreader to hunt for text.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Enumerations and constants
Level: Average difficulty
Course:
Exercise: Create resources for a project to hold your name, and a picture of yourself!.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Variables and constants
Level: Average difficulty
Course:
Exercise: Write code to get a calculator to validate and add numbers.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Lists
Level: Average difficulty
Course:
Exercise: Import lines from a text file to build up a list and display its items.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Loops
Level: Average difficulty
Course:
Exercise: Validate the controls on a form by looping over them within groupboxes.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Passing arguments
Level: Average difficulty
Course:
Exercise: Calculate the desirability quotient of a man, given the car he drives and who he looks like.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating classes
Level: Average difficulty
Course:
Exercise: Create a Countdown game, using a class to generate each letter.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Testing conditions
Level: Average difficulty
Course:
Exercise: Validate a dating agency application form's text boxes.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Variables and data types
Level: Average difficulty
Course:
Exercise: Create a DateTimePicker to for date of birth entry, then calculate the age of the applicant from this using variables.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Variables and data types
Level: Average difficulty
Course:
Exercise: Converting variable data types - create a form for someone to input their name and the amount of money they need spending on them.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Working with files
Level: Average difficulty
Course:
Exercise: Search line by line through a set of text files for a missing person.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating properties
Level: Average difficulty
Course:
Exercise: Calculate Body Mass Index using 3 read-only properties.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Advanced DataGridViews
Level: Harder than average
Course:
Exercise: Create a full system: click on a button next to a film in a list to see its details in a separate form.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Advanced DataGridViews
Level: Harder than average
Course:
Exercise: Create a DataGridView to include a combo box bound to another table, and a button for editing each row.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Working with files
Level: Harder than average
Course:
Exercise: Write a VB.NET routine to loop over files in a folder, finding the largest.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Form events
Level: Harder than average
Course:
Exercise: Create a form such that when a user choosee their gender from a drop list, a webbrowser control displays a suitable website.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating properties
Level: Harder than average
Course:
Exercise: Play Snog, Marry or Avoid using lists, list boxes and VB.NET.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Using arrays
Level: Harder than average
Course:
Exercise: Using splitting and arrays, find the oldest person in a comma-delimited list.

Go to exercise ...

Software: Visual Basic
Version: Any version of VB
Topic: Creating classes
Level: Harder than average
Course:
Exercise: Play Pairs in a form, creating classes to refer to each card and to each turn.

Go to exercise ...

You can search our full list of Visual Basic exercises here. Or why not learn to do them the right way on one of our classroom Visual Basic training courses in the UK, or on one of our live online Visual Basic courses wherever you are in the world?

This page has 0 threads Add post