Computer Science  ·  Level 6
Information Systems Development
Chapter 6: Develop and test a VB.NET application
📚 7 Topics
⚑ What you will be able to do

By the end of this chapter, you will be able to:

  • accurately apply basic VB.Net controls in your applications
  • correctly use the elements of a control within VB.Net
  • effectively use properties, methods, and events of basic VB.Net controls
  • handle events in VB.Net applications following proper programming practices
  • design user-friendly forms by applying Human-Computer Interaction (HCI) principles
  • safely and correctly connect your VB.Net applications to a database
  • test and deploy VB.Net applications following the right procedures to ensure they work properly

These skills will help you build reliable, user-friendly applications that meet real-world needs in the tech industry!

Developing and testing applications using VB.NET is a fundamental skill for computer science professionals aiming to build robust Windows-based software solutions. In Kenya's growing technology sector, from financial institutions like Equity Bank to county government offices digitizing their services, mastering VB.NET controls and their behavior enhances the user interface and functionality of applications. This chapter explores the essential components of VB.NET controls, their properties, methods, and events, providing a strong foundation for developing responsive and maintainable applications.

6.1 Basic VB.Net Controls

VB.NET controls are the building blocks of any user interface, enabling interaction between the user and the application. Understanding the types of controls available and their purposes allows developers to design intuitive forms that meet user requirements effectively. Additionally, adhering to standard naming conventions improves code readability and maintenance, which is crucial in professional software development environments such as university administrative systems or hospital patient management software.

6.1.1 Test Controls and Their Purpose

Test controls in VB.NET serve as interactive elements on forms that allow users to input, display, or manipulate data. Each control type is designed to fulfill specific interaction needs within an application.

Common VB.NET Controls and Their Uses

  • TextBox: Enables users to input or edit text. For example, in a SACCO membership application, TextBoxes collect member names and contact details.
  • Label: Displays static text or information that describes other controls, such as field names in a loan application form.
  • Button: Executes code when clicked, such as submitting a registration form in a university portal.
  • CheckBox: Allows users to select or deselect options independently, useful in preference settings in a hotel booking system.
  • RadioButton: Offers mutually exclusive choices, often for selecting gender or payment methods in an insurance claim form.
  • ComboBox: Provides a dropdown list of options, facilitating easy selection from predefined values, like selecting county names in a government service app.
  • ListBox: Displays a list of items from which users can select one or multiple entries, useful in inventory management systems.
  • DataGridView: Shows tabular data with sorting and editing capabilities, essential in accounting software for displaying transaction records.

Purpose of Test Controls in Application Development

Test controls facilitate user interaction, data validation, and provide feedback. For example, in a hospital system, Buttons and TextBoxes work together to schedule appointments, while Labels inform users of errors or successful operations. Selecting the right control aligns with the functionality required, improving the user experience and reducing input errors.

6.1.2 Standard Naming Conventions for Controls

Consistent naming of controls in VB.NET projects is vital for code clarity and maintainability. This is especially important in team environments such as software development firms servicing Nairobi's banking sector, where multiple developers collaborate on large codebases.

Principles of Naming Controls

  • Prefix Indicating Control Type: Use a short prefix to denote the control type, such as txt for TextBox, lbl for Label, or btn for Button.
  • Descriptive Name: Follow the prefix with a meaningful name that reflects the control’s purpose or content, like txtCustomerName or btnSubmitForm.
  • Camel Case Format: Use camel case (lowercase prefix, uppercase first letter of subsequent words) for readability, e.g., chkTermsAccepted.
  • Avoid Abbreviations That Are Not Standard: Use widely recognized abbreviations to prevent confusion among developers.
  • Uniqueness: Each control name must be unique within the form to avoid conflicts during coding and debugging.

Benefits of Using Standard Naming Conventions

Standardized names aid in quickly identifying control types and their roles in the code. For instance, when maintaining a payroll system for a county government, developers can instantly recognize btnCalculateSalary as a Button control that triggers salary computation. This reduces errors and speeds up troubleshooting.

The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒6.2 Elements of a Control

Understanding the elements of a control is fundamental for manipulating its behavior programmatically. Each control in VB.NET encapsulates properties, methods, and events that define its appearance, functionality, and responsiveness to user actions. Properties…

🔒6.3 Demonstrating Properties, Methods and Events

In the development of VB.NET applications, understanding how to manipulate controls through their properties, methods, and events is fundamental. These components allow developers to create interactive and dynamic user interfaces essential for robust software…

🔒6.4 Demonstrating event handling

Event handling is a critical aspect of interactive VB.NET applications, enabling programs to respond dynamically to user inputs. In the Kenyan software development industry, particularly among firms building desktop solutions for banks, educational institution…

🔒6.5 Designing VB.NET form using HCI principles

Designing VB.NET forms with Human-Computer Interaction (HCI) principles ensures that applications are intuitive, efficient, and accessible. Kenyan software developers working on projects for public institutions, such as county government offices or educational…

🔒6.6 Connection VB.Net Applications to a Database

In contemporary Kenyan software development environments, particularly within financial institutions, healthcare systems, and government agencies, the ability to connect VB.Net applications to databases is fundamental. This connection enables dynamic data hand…

🔒6.7 Deployment of VB.NET Applications

Deployment is a critical phase in the software development lifecycle, especially for VB.NET applications used in Kenyan enterprises such as banks, universities, and county government offices. Deployment involves preparing the VB.NET application for installatio…

Chapter Summary

This chapter explored the development and testing of a VB.NET application by first introducing basic VB.NET controls and their purposes, alongside standard naming conventions that enhance code readability and maintenance. It then examined the core elements of a control, including properties, methods, and events, explaining how each contributes to control behavior and user interaction. The chapter demonstrated how to manipulate these elements for basic controls, detailing the setting of properties both at design time and run time, and how to implement methods and respond to events. Event handling was further illustrated through mouse and keyboard events, highlighting how user inputs can trigger specific application responses. The design of VB.NET forms was discussed with emphasis on applying human-computer interaction principles to create user-friendly interfaces. The connection of VB.NET applications to databases was covered by introducing the ADO.NET object model, demonstrating database connections using data providers, and creating tables with dataset components. Finally, the chapter concluded with the deployment of VB.NET applications, outlining the purpose of deployment and the essential steps involved in preparing an application for release.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

A. Written Assessment

  1. What is the main purpose of using controls in a VB.NET application? (2 marks)
  2. Identify three standard naming conventions for VB.NET controls and explain why they are important. (3 marks)
🔒20 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. Explain the purpose of the following basic VB.NET controls: TextBox, Button, and Label. Illustrate your answer with examples relevant to a banking application in Kenya. (4 marks)
  2. Describe the standard naming conventions used for VB.NET controls and explain why adhering to these conventions is important when developing applications. (4 marks)
🔒18 more in this section.

Chapter Practical Activities

Practical 1: Create a VB.Net Form with Basic Controls for Student Registration

Computer Science · Level 6
Information Systems Development
PRACTICAL ASSESSMENT
TIME: 4 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Create a VB.Net Windows Form named 'StudentRegistrationForm' measuring approximately 600 x 400 pixels containing labels, textboxes, radiobuttons, combobox, and buttons for student data entry.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Computer with Microsoft Visual Studio 2019VB.Net development environment
KeyboardSample student data for testing
Mouse
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Computer with Microsoft Visual Studio 2019 installed1 Pc per Candidate
2Internet accessAs needed
3Flash disk1 Pc per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Design and Implement Student Registration Form
Observed use of computer laboratory rules and setup
(Award 2 marks or 0)
2
Launched Microsoft Visual Studio 2019 successfully
(Award 2 marks or 0)
2
Created a new VB.Net Windows Forms project named 'StudentRegistrationForm'
(Award 2 marks or 0)
2
Designed the form with appropriate size (approximately 600 x 400 pixels)
(Award 3 marks or 0)
3
Added labels for the following fields: Student ID, First Name, Last Name, Gender, Course, and Submit button
(Award 1 mark for each label correctly added or 0)
6
Added textboxes for Student ID, First Name, and Last Name
(Award 1 mark for each textbox correctly added or 0)
3
Added radiobuttons for Gender selection (Male, Female)
(Award 3 marks if both radiobuttons correctly added and grouped, else 0)
3
Added a combobox for Course selection with at least three courses (e.g. IT, Business, Engineering)
(Award 4 marks if combobox and courses correctly added, else 0)
4
Added a Submit button to the form
(Award 2 marks if button correctly added and named, else 0)
2
Implemented code to display a message box showing 'Registration Successful' when Submit button is clicked
(Award 5 marks for correct event handler and message box code, else 0)
5
Tested the form by entering sample data and clicking Submit
(Award 3 marks if form tested and behaves as expected, else 0)
3
Sub-Total35
PRODUCT CHECKLIST
Form size approximately 600 x 400 pixels with all required controls placed neatly
(Award 4 marks if form size and layout are correct, else 0)
4
Labels correctly named and aligned with corresponding controls
(Award 4 marks if all labels are correct and aligned, else 0)
4
Textboxes, radiobuttons, combobox, and button present and functional
(Award 5 marks if all controls are present and usable, else 0)
5
Submit button triggers message box with text 'Registration Successful'
(Award 7 marks if message box displays correctly upon button click, else 0)
7
Sub-Total20
GRAND TOTAL55
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)

Practical 2: Rename VB.NET Form Controls Using Standard Naming Conventions

Computer Science · Level 6
Information Systems Development
PRACTICAL ASSESSMENT
TIME: 4 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Rename all controls on a VB.NET form named 'StudentRegistrationForm' sized 800mm x 600mm following standard VB.NET naming conventions.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Computer with Microsoft Visual Studio 2019 installedVB.NET project file with form containing controls
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Computer with Microsoft Visual Studio 2019 installed1 Pc per Candidate
2Flash disk1 Pc per Candidate
3VB.NET project file with form containing controls1 set per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Apply Standard Naming Conventions to Controls
Observed candidate launching Microsoft Visual Studio 2019
(Award 2 marks or 0)
2
Opened the provided VB.NET project and loaded 'StudentRegistrationForm'
(Award 3 marks or 0)
3
Identified all controls on the form (labels, textboxes, buttons, combo boxes, etc.)
(Award 4 marks or 0)
4
Renamed textboxes using 'txt' prefix followed by descriptive name (e.g., txtStudentName)
(Award 1 mark for each correctly renamed textbox up to 5 textboxes)
5
Renamed labels using 'lbl' prefix followed by descriptive name (e.g., lblStudentName)
(Award 1 mark for each correctly renamed label up to 3 labels)
3
Renamed buttons using 'btn' prefix followed by descriptive name (e.g., btnSubmit)
(Award 1 mark for each correctly renamed button up to 3 buttons)
3
Renamed combo boxes using 'cmb' prefix followed by descriptive name (e.g., cmbClass)
(Award 1 mark for each correctly renamed combo box up to 2 combo boxes)
2
Saved the project with all naming changes applied
(Award 2 marks or 0)
2
Sub-Total24
PRODUCT CHECKLIST
All controls on 'StudentRegistrationForm' renamed correctly using standard VB.NET naming conventions
(Award 6 marks if all controls follow naming conventions exactly, otherwise 0)
6
Form size remains 800mm x 600mm with no layout distortion
(Award 4 marks if form size and layout are maintained, otherwise 0)
4
Sub-Total10
GRAND TOTAL34
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)
🔒

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒Develop and Test a VB.NET Form Demonstrating Control ElementsPractical 3
🔒Set and Modify Properties of Basic Controls in VB.NET ApplicationPractical 4
🔒Develop and test a VB.NET application to invoke methods of basic controlsPractical 5
🔒Develop and test a VB.NET application handling events for basic controlsPractical 6
🔒Develop and Test VB.NET Application Demonstrating Properties, Methods and EventsPractical 7
🔒Implement Mouse Event Handling in a VB.NET ApplicationPractical 8
🔒Implement Keyboard Event Handling in a VB.NET ApplicationPractical 9
🔒Design a VB.NET Form Using HCI PrinciplesPractical 10
🔒Develop and Test a VB.Net Application Connecting to a DatabasePractical 11
🔒Develop and Test a VB.NET Application Demonstrating Database Connection Using the Data ProviderPractical 12
🔒Develop and Test a VB.NET Application with Dataset TablesPractical 13
🔒Explain the Purpose of Deployment for VB.Net ApplicationsPractical 14
🔒Package and Deploy a VB.Net ApplicationPractical 15
Flashcards 20 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

18 more in this section.

Create a free account
Test Yourself 17 questions Start quiz ▾
0%
0 / 2
🔒

15 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • accurately apply basic VB.Net controls in your applications
  • correctly use the elements of a control within VB.Net
  • effectively use properties, methods, and events of basic VB.Net controls
  • handle events in VB.Net applications following proper programming practices
  • design user-friendly forms by applying Human-Computer Interaction (HCI) principles
  • safely and correctly connect your VB.Net applications to a database
  • test and deploy VB.Net applications following the right procedures to ensure they work properly

Tick each one you can genuinely do.

So, are you there yet?

You're competent when you can confidently do 50% or more of what this chapter promised.

Sign in to record how you're doing.