Solved

Problem with Form Inheritance

Posted on 2007-11-19
4
189 Views
Last Modified: 2010-04-23
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 DemographicDataInformedConsent
    Inherits Humanitas.FormsCommon

    TableCode = "SDEM"
------------------------------

...but I simply get: "TableCode is not declared".

What am I doing wrong?
0
Comment
Question by:Emanuele_Ciriachi
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
cottsak earned 256 total points
ID: 20317911
you might need to add the 1st prject as a reference to the second. before you do that the parent class wont be visible.
0
 
LVL 8

Expert Comment

by:doraiswamy
ID: 20318205
You would also need to add

imports humanitas

at the beginning of the code for the second project
0
 
LVL 1

Author Comment

by:Emanuele_Ciriachi
ID: 20319364
Importing the base class project in the forms which extend it worked, thank you.
0
 
LVL 1

Author Closing Comment

by:Emanuele_Ciriachi
ID: 31410066
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.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Creating a route in asp.net webforms 2 25
Modal Popup Extender control 1 20
Sending receiving text messages in vb.net 15 33
vb.net class 3 12
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question