How to Add Form Inside a Form in VB.Net

This time in my tutorial I’m going to teach you how to add Form inside a Form in Adding a form inside the form is very useful to all the programmers that is developing a windows application or a software. Form is a very important element because it helps hold the object like textbox, button, label and etc. In this way, even a form can also be added in a Form. This kind of function is useful for your design to be responsive no matter what’s the size of your second Form, it remains inside the main Form. If the second Form is larger than the main Form you can still view it in whole by using the Y and X access scroll. Let’s begin: Open a Microsoft Visual Studio 2015 and create a new windows form application. f1 After that, add another form like shown below. f2 In the Form1, add a button and double click to fire the event handler of it. f3 Do the following codes for adding a form inside the form.
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2. 'Gets or sets a value indicating whether the form is a container for more multiple-document interface (MDI) child forms
  3. Me.IsMdiContainer = True
  4. With Form2
  5. 'sets the current multiple-document interface(MDI) parent form of this form
  6. .MdiParent = Me
  7. 'show the form2
  8. .Show()
  9. End With
  10. End Sub
Finally, press f5 the run the project. For any questions about this article. You can contact me @ Email – [email protected] Mobile No. – 09305235027 – TNT FB Account –

Add new comment