Custom Class not responding while using toplevel = False

  • Thread starter Thread starter Habib ur rehman
  • Start date Start date
H

Habib ur rehman

Guest
1) MainForm 2) CustomerForm 3) ClassCustomFunctions

I used functions like adding, retrieving, deleting data in "ClassCustomFunctions" which is used by "CustomerForm" and the "CustomerForm" is child form to "MainForm" and loads into a panel with the following code:

Private Sub CForm_Click(sender As Object, e As EventArgs) Handles CForm.Click
Panel_Container.Controls.Clear()
Dim Cust As New CustomerForm With {.TopLevel = False}
P_Container.Controls.Add(Cust)
Cust.Show()
End Sub

When CustomerForm loads into MainForm all the functions that I used in ClassCustomFunctions seems idle (as they aren't called) no signs of any error or warnings.

I debug CustomerForm as startup form and found that all the functions I used in ClassCustomFunctions are 100% working.

To check again, I skipped using ClassCustomFunctions and transferred all the functions to CustomerForm. When I loaded CustomerForm with the same upper code I was surprised that now it was working.

If I use MainForm for opening CustomerForm then ClassCustomFunctions won't work. Why is it not working this way? Am I missing something or the code I used above for opening CustomerForm is a wrong approach.

Thanks for you Help in advance.


Habib Ur Rehman

Continue reading...
 
Back
Top