Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:19:26+00:00 2026-06-05T02:19:26+00:00

Need some help in the VB.NET, not sure where I am doing wrong Background:

  • 0

Need some help in the VB.NET, not sure where I am doing wrong

Background: I have a master form which uses the SplitContainer control. The PANEL1 of the split carries the MenuStrip and Panel2 is used to call related external forms enter image description here

Code (refer below): Function ResetSplitContainerPanel2 clears the Panel2 and loads the new form using the SetFormAttributesToLoadInPanel2

Issue: Although SettingSplitContainer.Panel2.Controls.Clear() clears the Panel2 but the form still maintains the form in the editable mode. If I call the same form again, I can see the values which I typed earlier

Output Expected: On Load of new form, the previous loaded form in PANEL2 should be disposed completely

Private Sub ResetSplitContainerPanel2()
    SettingSplitContainer.Panel2.Controls.Clear()
End Sub

Private Function SetFormAttributesToLoadInPanel2(ByVal formNameToChange As Form) As Boolean
        On Error GoTo errHandler

        formNameToChange.IsMdiContainer = False
        formNameToChange.ShowInTaskbar = False
        formNameToChange.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        formNameToChange.ControlBox = False
        formNameToChange.TopLevel = False
        formNameToChange.Text = ""
        formNameToChange.Visible = True
        formNameToChange.Width = SettingSplitContainer.Panel2.Width
        formNameToChange.Height = SettingSplitContainer.Panel2.Height

        SetFormAttributesToLoadInPanel2 = False
        Exit Function

errHandler:
        MsgBox("Error Description: " & Err.Description, vbOKOnly, "Error")
        SetFormAttributesToLoadInPanel2 = True
        Exit Function
    End Function

Appreciate your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:19:29+00:00Added an answer on June 5, 2026 at 2:19 am

    I will try to use the dispose method instead of Clear:

    Dim f As Form = TryCast(SettingSplitContainer.Panel2.Controls(0), Form)
    if f IsNot Nothing then
       f.Dispose()
    Endif
    

    Not sure if your form has been added to the SplitContainer as the first control in the Panel2.Controls collection. However this will be simply to check.

    The underlying reason for this change could be found in this answer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help with a LINQ query in VB.Net, please. I have this
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some help with a query.. I have three tables. Source id name 1
Need some help with DataFormatString in GridView. I have a Double value that needs
I need some help. I'm looking to have a sidebar that toggles when a
I have 2 scenarios that I need some help with re validation in my
Okay, I am stumped on this one and need some quick help. I have
I really have not worked much with XML and I would appreciate some help.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.