Advanced 60 min read All 29 Controls Step by Step

Full WinForms Project

Build a complete Windows Forms application using all 29 controls from the Toolbox. Follow this step-by-step guide.

IMPORTANT: You will ONLY drag controls from the Toolbox. DO NOT touch or edit the MainForm.Designer.cs file. The designer file is auto-generated and will be updated automatically when you drag controls.

Project Overview

We'll build a "Student Management System" that uses every control in the Windows Forms Toolbox.

29 Controls
Drag & Drop
Full Code
Working App

Part 1: Project Setup


Step 1: Open Visual Studio

Open Visual Studio 2022 from your Start Menu or Desktop shortcut.

Need Visual Studio? Download it for free from visualstudio.microsoft.com

Step 2: Create New Project

  1. Click "Create a new project"
  2. Search for "Windows Forms App"
  3. Select "Windows Forms App (.NET Framework)"
  4. Click "Next"
Project Name: StudentManager
Location: C:\Users\YourName\Documents\Projects\
Framework: .NET 8.0
Project Name StudentManager .NET 8.0

Step 3: Understand the Solution Explorer

After creating the project, look at the Solution Explorer on the right side. You'll see this structure:

📁 StudentManager/
├── 📁 Properties/
│   └── Resources.resx          (Images, icons - we'll use this)
├── 📄 Form1.cs                 (Your code - we'll rename this)
├── 📄 Form1.Designer.cs        (⚠️ DO NOT TOUCH this file!)
├── 📄 Program.cs               (Entry point - don't change)
├── 📄 App.config               (Settings - don't change)
└── 📄 StudentManager.csproj    (Project file)
REMEMBER: Form1.Designer.cs is auto-generated. NEVER edit it manually!

Step 4: Rename Form1 to MainForm

  1. In Solution Explorer, right-click on Form1.cs
  2. Select "Rename"
  3. Change it to MainForm.cs
  4. Press Enter
  5. When asked, click "Yes" to rename all references
Done! You should now see MainForm.cs in Solution Explorer.

Part 2: Basic Controls


Step 5: Open the Form Designer

Double-click on MainForm.cs in Solution Explorer to open the form designer. You should see a blank form.

Make sure: The Toolbox is visible. If not, go to View → Toolbox.

Step 6: Add Controls (Drag from Toolbox)

IMPORTANT: For each control, drag it from the Toolbox onto the form. DO NOT type code - the designer will handle everything!

REMEMBER: You are only dragging controls from the Toolbox. You will never open or edit the MainForm.Designer.cs file.
Add these controls in order:
# Control Name Text/Properties Where to Find
1 Label lblTitle "Student Manager" Toolbox → Common Controls
2 TextBox txtFirstName "" Toolbox → Common Controls
3 TextBox txtLastName "" Toolbox → Common Controls
4 Button btnSave "Save Student" Toolbox → Common Controls
5 CheckBox chkActive "Active" Toolbox → Common Controls
6 RadioButton rbMale "Male" Toolbox → Common Controls
7 RadioButton rbFemale "Female" Toolbox → Common Controls
8 ComboBox cmbCourse Items: Math, Science, History Toolbox → Common Controls
9 ListBox lstStudents Items: (empty for now) Toolbox → Common Controls
10 CheckedListBox clbHobbies Items: Reading, Sports, Music Toolbox → Common Controls

Part 3: Container Controls


Step 7: Add Container Controls

# Control Name Properties Where to Find
11 GroupBox grpPersonalInfo Text: "Personal Information" Toolbox → Containers
12 Panel pnlButtons Dock: Bottom Toolbox → Containers
13 SplitContainer splitContainer Orientation: Vertical Toolbox → Containers
14 TableLayoutPanel tblLayout 2 columns, 5 rows Toolbox → Containers
15 DataGridView dgvStudents Dock: Fill Toolbox → Data
16 ListView lvStudents View: Details Toolbox → Common Controls
Tip: Drag the SplitContainer first, then drag other controls inside its panels.

Part 4: Specialized Controls


Step 8: Add Specialized Controls

# Control Name Properties Where to Find
17 DateTimePicker dtpBirthDate Format: Short Toolbox → Common Controls
18 PictureBox pbProfile SizeMode: Zoom Toolbox → Common Controls
19 ImageList imgList Images: Add icons (click the ... button) Toolbox → Components
20 RichTextBox rtbNotes "" Toolbox → Common Controls
21 WebBrowser webBrowser Navigate to "about:blank" Toolbox → Common Controls
22 Timer timerClock Interval: 1000 (Enabled: false) Toolbox → Components
23 LinkLabel llHelp "Need Help?" Toolbox → Common Controls
Note: The ImageList and Timer controls appear in the component tray (the gray area below the form), not on the form itself.

Part 5: Menus & Dialogs


Step 9: Add Menus & Dialogs

# Control Name Properties Where to Find
24 MenuStrip menuStrip Add: File, Edit, Help Toolbox → Menus & Toolbars
25 ToolStrip toolStrip Add buttons: New, Save, Print Toolbox → Menus & Toolbars
26 NotifyIcon notifyIcon Icon: Set (click ... to choose) Toolbox → Components
27 SaveFileDialog saveFileDialog Filter: "Text files|*.txt" Toolbox → Dialogs
28 PrintDocument printDocument - Toolbox → Printing
29 PrintPreviewDialog printPreviewDialog - Toolbox → Dialogs
Tip for MenuStrip: Click on the MenuStrip, then type directly into the "Type Here" boxes to add menu items.

Part 6: Write the Code


Step 10: Open MainForm.cs

Now we'll write the code. Double-click on MainForm.cs in Solution Explorer (not the designer file).

You'll see the code-behind file where we'll add our logic.

Step 11: Add the Code

Copy and paste the code below into MainForm.cs.

IMPORTANT: Make sure the code matches the control names you used.
11a. Add the Student Class
11b. Add the Data Store
11c. Add the Form Load Code
11d. Add the Save Button Click
11e. Add the Timer Tick
11f. Add the Full Code (All Together)

Part 7: Run the Project


Step 12: Run and Test

  1. Press F5 to run the project
  2. Test adding students with all controls
  3. Test the menu items (File, Edit, Help)
  4. Test the ToolStrip buttons
  5. Test printing
  6. Verify everything works
Congratulations! You've built a complete Windows Forms application using all 29 controls from the Toolbox!

All 29 Controls Used

You have successfully used every control from the Toolbox:

  • Label
  • TextBox
  • Button
  • CheckBox
  • RadioButton
  • ComboBox
  • ListBox
  • CheckedListBox
  • GroupBox
  • Panel
  • SplitContainer
  • TableLayoutPanel
  • DataGridView
  • ListView
  • DateTimePicker
  • PictureBox
  • ImageList
  • RichTextBox
  • WebBrowser
  • Timer
  • LinkLabel
  • MenuStrip
  • ToolStrip
  • NotifyIcon
  • SaveFileDialog
  • PrintDocument
  • PrintPreviewDialog
  • PageSetupDialog
  • PrintDialog
29/29 Controls Used Complete Project