azad education azad education

The next-generation blog, news about technology.

India (HQ)

[email protected]

how to show windows forms in panel in vb.net

azad education
Azad Education Sep 20, 2023 · 1 min read

How  to show windows forms in a panel in vb.net code

create a function with form parameter as a form object

copy this code and apply anywhere in the form

 Dim currentForm As Form
    Sub formOpen(ByVal form1 As Form)
        If currentForm IsNot Nothing Then
            currentForm.Close()
        End If

        currentForm = form1
        Panel1.Controls.Clear()
        form1.TopLevel = False
        Panel1.Controls.Add(form1)
        form1.Show()

    End Sub

Now create a Button on click event and call this form

  formOpen(Form4)

Note Form4 is form name you would be paas only form name as parameter.

 

avatar

Azad Mohammed

An editor at AzadEducation
View Articles

I'am Azad, These blogs, tech skills and programing news, I am sharing with my exprience. I have 4+ year experiece in the web development. Also we are learning investing ideas. I believe in "big mind big dream", that will convert in smart mind. You can follow me on Linkedin profile.

Categories
C#
10
Java Script
8
SEO
4
Quick Hack Solution Tips
4

Subscribe to our mailing list!

We don't spam