0
Answer

Using the same Tab Page in two different Forms

Cristiano Radicchi

Cristiano Radicchi

10y
554
1
Hello,
I'm working on a project (VS2010 + C#) where I have two forms (and classes), named "Subjects" and "Contacts" that use the same group of controls to define part of the attributes that are in common between them, such as, for example, the "Addresses" information.
By the way, "Addresses" is a separate class that in the underlying DB can be referenced either to the "Subjects" or to the "Contacts" tables.
I would like to add a Tab Page in both of the forms to let the user insert the address data but without duplicating the tab controls as well as their related code.
In fact, I could easily design the controls and write all the code needed to handle both controls data and behavior in the first Form and then copy all the stuff in the second Form.
Is there a more efficient way to do it ? In other words, by doing the work only once designing a dedicated control (a third form ?) and "including" (or calling / loading) it in the Tab Pages of both the forms ?
Thank you in advance for your answers.