how can i close form when close tabpage in added form to tabpage

hi,

i have tabcontroladv with close button,i added form inside tabpage.

i want to close added form  when tabpage close button click.

because run form load event code only first time, when close and open tabpage can't run load code again

can you help me for this?

thanks 


3 Replies

SN Sudharsan Narayanan Syncfusion Team March 2, 2022 03:22 AM UTC

Hi Serdar,

We were unable to reproduce the reported issue that "form load event is not triggered" from our end. If we add the form inside the TabPageAdv, the form load event will trigger properly when we open and close the TabPageAdv in the TabControlExt. Please see the sample provided below.

Sample: https://www.syncfusion.com/downloads/support/forum/173275/ze/TestingTabControlExt-1830983627


Please check the sample and let us know your concerns. If we misunderstood your query, please modify the sample, and share the details about the replication steps of the reported query and video for the same. So, it would be helpful for us to proceed further and provide a prompt solution to this.

Regards,
Sudharsan



SE Serdar March 7, 2022 06:19 PM UTC

hi  ,

I applied code is this;

  Dim Newtab As TabPageAdv = New TabPageExt(FormName .Text)

                AddHandler Newtab.Closing, AddressOf tabPageAdv1_Closing

               Tabcontrol1.Controls.Add(Newtab)


Newtab.Tag = Form.Name

                Form.Parent = Newtab

                Form.Visible = True


                Form.Dock = DockStyle.Fill

                Tabcontrol1.SelectedIndex = Tabcontrol1.TabPages.Count - 1

                Form.Select()


Private Sub tabPageAdv1_Closing(ByVal sender As Object, ByVal args As TabPageAdvClosingEventArgs)

        Dim f As Form = CType(Application.OpenForms(Tabcontrol1.SelectedTab.Tag), Form)

        f.Close()

    End Sub


thanks for reply



SN Sudharsan Narayanan Syncfusion Team March 9, 2022 03:24 AM UTC

Hi Serdar,

We have checked the reported query with TabControlExt, but we are unable to understand what is your exact requirement.? So can you update us any simple sample or video that replicates your requirement, it would be helpful for us to provide you the prompt solution at the earliest. 

Now, we are prepared the sample with your code snippet from last update. We were unable to reproduce the reported issue from our end. Please see the sample provided below.

Sample: https://www.syncfusion.com/downloads/support/forum/173275/ze/TabControlExtForm704894059


Please check the sample and let us know your concerns. If we misunderstood your query, please modify the sample, and share the more details.

Regards,
Sudharsan


Loader.
Up arrow icon