Emanuele_Ciriachi
asked on
Problem with Form Inheritance
Hello, I don't seem to be able to have a simple Form Inheritance in my project.
I have a separate project in my solution with a single .vb form, with the following code:
------------------------
Public Class FormsCommon
Public ErrorPresent As Boolean
Public AlreadyDone As Boolean
Public TableCode As String
Private Sub FormsCommon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Public Interface CommonInterface
Sub ControllaForm()
End Interface
-------------------------- -----
Then I try to create, in another project, a VB form that inherits from this one:
-------------------------- ----
Public Class DemographicDataInformedCon sent
Inherits Humanitas.FormsCommon
TableCode = "SDEM"
-------------------------- ----
...but I simply get: "TableCode is not declared".
What am I doing wrong?
I have a separate project in my solution with a single .vb form, with the following code:
------------------------
Public Class FormsCommon
Public ErrorPresent As Boolean
Public AlreadyDone As Boolean
Public TableCode As String
Private Sub FormsCommon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Public Interface CommonInterface
Sub ControllaForm()
End Interface
--------------------------
Then I try to create, in another project, a VB form that inherits from this one:
--------------------------
Public Class DemographicDataInformedCon
Inherits Humanitas.FormsCommon
TableCode = "SDEM"
--------------------------
...but I simply get: "TableCode is not declared".
What am I doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Importing the base class project in the forms which extend it worked, thank you.
ASKER
Nice and quick, managed to get me back on track and as such I give an "A". Would have liked an example to make the solution even more complete.
imports humanitas
at the beginning of the code for the second project