Solved

Problem with Form Inheritance

Posted on 2007-11-19
4
188 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now