Featured Article

MDI Form in VB NET Tutorialspoint Step by Step Guide

Kenneth Jul 13, 2026

Have you been looking to enhance the visual appeal of your VB.NET applications? Material Design for Icons (MDI) is a perfect toolkit to create beautiful and responsive designs. If you're new to MDI Forms in VB.NET, you're in the right place. This tutorial will guide you through the process of creating, styling, and using MDI Forms, transforming your applications into visually engaging experiences.

Tips and Tricks for the VB-MAPP - Simply Special Ed
Tips and Tricks for the VB-MAPP - Simply Special Ed

MDI (Multiple Document Interface) forms allow developers to create applications with a main window and multiple child windows, enhancing user interaction and task management. By the end of this tutorial, you'll be equipped to leverage the power of MDI Forms in VB.NET, implementing a robust and user-friendly design.

VB.net Program Structure Example
VB.net Program Structure Example

Setting Up Your VB.NET Environment for MDI Forms

Before we dive into MDI forms, ensure you have the latest Visual Studio installed with the 'Desktop development with C#' or 'Desktop development with VB' workload. This includes the necessary tools and libraries to create and design UI applications.

MS Access Unbound Forms and VBA
MS Access Unbound Forms and VBA

For this tutorial, we'll be using VB.NET. If you're already set up, let's proceed to create our first MDI Form.

Creating an MDI Form in VB.NET

How to make an InstallerSetup from your VB.Net Project?
How to make an InstallerSetup from your VB.Net Project?

To create an MDI Form, open Visual Studio and start a new Windows Forms App (.NET). Name the project 'MDITutorial'. Next, drag and drop an 'MDI Form' from the Toolbox onto the design surface. This is your main window, where child windows will be displayed.

Right-click on the 'Form1.xaml' in the Solution Explorer, rename it to 'MDIParent.vb'. This will become your main MDI parent form. To add a child form, follow these steps:

Adding Child Forms to the MDI Parent

a screenshot of the vba user form
a screenshot of the vba user form

Create a new 'Form' and name it 'ChildForm.vb'. This will be our child window. To enable the MDI Parent to host this child form, we need to modify the 'MDIParent.vb' code. Here's how:

  • Double-click the 'MDIParent.vb' to create a Click event handler.
  • Add the following code to display the 'ChildForm.vb' whenever the MDIParent form is clicked:

Private Sub MDIParent_Click(sender As Object, e As EventArgs) Handles MyBase.Click
    Dim Child As New ChildForm
    Child.MdiParent = Me
    Child.Show()
End Sub

Set a break-point at the 'Child.Show()' line and press F9 to navigate to the breakpoint. Run the application to see your first child form displayed within the MDIParent.

Top 10 Advanced Features of MS Forms
Top 10 Advanced Features of MS Forms

Customizing MDI Form Styling

The next step is to make your MDI Forms visually appealing. Material Design offers various themes and styles you can leverage. For this tutorial, let's use the 'MaterialDesignThemes{for}Blazor' NuGet package to add material design components to our VB.NET project.

Beginning .Net : Populating or Fill dropdownlist from Database table with C# Examples and VB.Net Examples
Beginning .Net : Populating or Fill dropdownlist from Database table with C# Examples and VB.Net Examples
How to Create a Form in Microsoft Word - MS Word Form Tutorial
How to Create a Form in Microsoft Word - MS Word Form Tutorial
How to Create and Design a VBA User Form
How to Create and Design a VBA User Form
How to Sum value of fields in a ms access form -VBA
How to Sum value of fields in a ms access form -VBA
The Ultimate List of Excel VBA Macro Codes (100+ Examples)
The Ultimate List of Excel VBA Macro Codes (100+ Examples)
Free Visual Basic .NET Book
Free Visual Basic .NET Book
Design a Form Filling Database Using Microsoft Access.
Design a Form Filling Database Using Microsoft Access.
MS Access - Create Form
MS Access - Create Form
WPF vs WinForms - Making the Right Decision in 2026 - NDepend Blog
WPF vs WinForms - Making the Right Decision in 2026 - NDepend Blog

To use material design components:

  • Right-click on your project in the Solution Explorer and select 'Manage NuGet Packages'.
  • Search for 'MaterialDesignThemes{for}Blazor'.
  • Select the first result, check the 'Include prerequisites' box and click 'Install

Now, you can start applying material design styles to your MDI Forms and Child Forms. Let's use the material design 'RaisedButton' as an example.

Adding Material Design Raised Buttons to your Forms

First, add an 'MDI Form' and 'Form' to your project. Name them 'MDIParentMaterial.vb' and 'ChildMaterial.vb' respectively. Then, add a 'RaisedButton' to each form from the 'Material Design' tab in the toolbox. Here's how to set up the button:

  • Name the buttons 'btnOpenChild' in 'MDIParentMaterial.vb' and 'btnClose' in 'ChildMaterial.vb'.
  • Set the 'Text' property of both buttons to 'Open Child Form' and 'Close' respectively.

For the 'btnOpenChild' event, you can use the same code from the previous 'MDIParent_Click' event handler. For 'btnClose' in the 'ChildMaterial.vb', use 'Me.Close()'.

Now, run the application with these material design changes. You should see raised buttons in both your MDI Parent and Child Form, enhancing the visual appeal of your application.

Handling Multiple Child Windows

In real-world applications, users may open multiple child windows. MDI Forms help manage these windows. Let's illustrate this by adding a 'CloseAll' button to the 'MDIParentMaterial.vb'.

Here's the 'CloseAll' button event handler code:

Private Sub btnCloseAll_Click(sender As Object, e As EventArgs) Handles btnCloseAll.Click
    For Each child As Form In Me.MdiChildren
        child.Close()
    Next
End Sub

This code loop iterates through all open child windows and closes them when the 'CloseAll' button is clicked. By handling window management this way, users can effortlessly navigate between multiple child windows without overwhelm.

In this tutorial, we've effectively explored the creation, customization, and management of MDI Forms in VB.NET. Starting with basic setup all the way to handling multiple child windows, you're now equipped to create robust and visually engaging applications using MDI Forms and material design styles.

To further expand your knowledge, explore other material design components and visual customizations. Happy coding, and remember to keep learning and experimenting!