Saturday, 10 March 2018

How to Connect a VB.NET form (frmvendor.vb) with Mdi Container

Hello friends
Here i am going to tell you about a billing software with inventory system. I will tell you about the billing software with image and source code in vb.net .

First of all we will learn about the design of main window of Billing software with MenuStrip. Image of Main Screen given below.

We will go for developing software step by step
First of all we will learn about 4th option (vendor) of above image.

Step 1 :
How to create Vendor for Billing Software with Inventory System.
 we will go to Solution Explorer -> Right Click ->ADD -> New Item
open a window of new item then we will select Windows Form -> Window form 
and given the name frmvendor.vb and click on Add Button. You will see this form in the Solution Explorer and you will design this form like below image.

Step 2: We will connect frmvendor.vb with vendor button of Main Screen. first select frmmain.vb you will see in the property window in left side. you will get IsMdiContainer Property, change True. 
and now apply the source code on Vendor button of main screen given below.

''''''''''''''''''''''''This Code is for close all form, witch are open in the main screen''''''''''''''''''
Private Sub AllClose()
        For Each aform As Form In Me.MdiChildren
            aform.Dispose()
        Next
    End Sub

'''''''''''''''''''''''''''''''''''''''''''This Code is for open frmvendor.vb in main screen '''''''''''''''''''''''
 Private Sub VendorToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VendorToolStripMenuItem.Click
        AllClose()
        frmVendor.MdiParent = Me
        frmVendor.Dock = DockStyle.None
        frmVendor.Show()
    End Sub

No comments:

Post a Comment