473,378 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

overriding a variable??

Hello,
I have a Parent form call say MyProjectForm which is inherited, in
this I have a variable call MyProjectItemNode of type treenode.
I also have an overridable function called SelectNode in both the base and
inherited form. However my problem is that the variable MyProjectItemNode can
be of various different types all of which I inherit from the treenode,
therefore I wish to Override the variable in the original form and Use the
one in each inherited form and set it to the correct type in each form. I
don't want to use a type of Object in the base because this is bad coding.
Is this possible?

Regards
Geri
Nov 21 '05 #1
1 1644
"ghobley" <gh*****@discussions.microsoft.com> schrieb:
I have a Parent form call say MyProjectForm which is inherited, in
this I have a variable call MyProjectItemNode of type treenode.
I also have an overridable function called SelectNode in both the base and
inherited form. However my problem is that the variable MyProjectItemNode
can
be of various different types all of which I inherit from the treenode,
therefore I wish to Override the variable in the original form and Use
the
one in each inherited form and set it to the correct type in each form. I
don't want to use a type of Object in the base because this is bad coding.


Mark the variable as private and re-introduce a variable with the same name
but with a different type in the derived class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ovid | last post by:
Hi, I'm trying to determine the cleanest way to override class data in a subclass. class Universe { public String name; private static double PI = 3.1415; Universe(String name) {
4
by: user | last post by:
Hi, Is it possible to override assignment, the way that '+' can be overridden for example? Thanks, Toby
4
by: Eric Baker | last post by:
With this little snippet, i get an inconsistency between the behavior of string and dictionary class variables: Python 2.2.3 (#42, May 30 2003, 18:12:08) on win32 Type "copyright", "credits" or...
11
by: Achintya | last post by:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& #include<iostream> using namespace std; class A { int i; virtual void f(){ cout<<endl<<"i= "<<i; } public: A(int j) { i =...
3
by: Eric Chaves | last post by:
Hi fellows, According to the C# language specification (10.5.3), Every virtual method has a "most derived implementation" determined by a 3-step rule. If I invoke the virtual method from a normal...
4
by: ORi | last post by:
Hi all ! There's a question I've been bothering for a while: I'm actually developing architectural frameworks for application developing and I think virtual methods, although needed because of...
4
by: Raja Raman Sundararajan | last post by:
Hello guys, I have data stored in the database which has special characters like <, etc. Case 1: Whenever I wanted to present the output to a browser I need to escape these special characters...
10
by: r035198x | last post by:
The Object class has five non final methods namely equals, hashCode, toString, clone, and finalize. These were designed to be overridden according to specific general contracts. Other classes that...
3
Atli
by: Atli | last post by:
Hi everybody. This is not so much a problem, since I have already managed to find a solution, but my solution requires the use of the eval() function, which I just hate to use. The problem is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.