473,386 Members | 1,766 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,386 software developers and data experts.

C# : form Inheritance

RD
I created a base form with couple of buttons and wrote some code in the
button_click.

Then I inherited this form and created another one .
But I am not able to add more code into the button_click in the new form
(or I am not able to see the code).

Is it possible? If so how?

Thanks

Nov 15 '05 #1
5 3246
the code that you put is there, it just doesnt show because its hidden
(polymorphism?).
if you add new code it iwll execute the code you put in the original and the
new one.

if i undrestand your question right then thats the answer.
"RD" <di******@alltel.net> wrote in message news:5SEHb.10$TJ.4@fe01...
I created a base form with couple of buttons and wrote some code in the
button_click.

Then I inherited this form and created another one .
But I am not able to add more code into the button_click in the new form
(or I am not able to see the code).

Is it possible? If so how?

Thanks

Nov 15 '05 #2
RD
Still I have doubts.
Base code is not showing because of "Polymorphism". That part is clear
now.

But I am not able to see the "button_click()" module to write more code
into it (in the new form) .
Do I have to do any property setting to see the module?

Thanks

"Kovan" <ju********@rogers.com> wrote in message
news:V3*********************@news04.bloor.is.net.c able.rogers.com...
the code that you put is there, it just doesnt show because its hidden
(polymorphism?).
if you add new code it iwll execute the code you put in the original and the new one.

if i undrestand your question right then thats the answer.
"RD" <di******@alltel.net> wrote in message news:5SEHb.10$TJ.4@fe01...
I created a base form with couple of buttons and wrote some code in the
button_click.

Then I inherited this form and created another one .
But I am not able to add more code into the button_click in the new form (or I am not able to see the code).

Is it possible? If so how?

Thanks



Nov 15 '05 #3
on the form, double click the button it shoudl automatically take you to the
code module

"RD" <di******@alltel.net> wrote in message news:yuGHb.6$Bc.4@fe10...
Still I have doubts.
Base code is not showing because of "Polymorphism". That part is clear
now.

But I am not able to see the "button_click()" module to write more code
into it (in the new form) .
Do I have to do any property setting to see the module?

Thanks

"Kovan" <ju********@rogers.com> wrote in message
news:V3*********************@news04.bloor.is.net.c able.rogers.com...
the code that you put is there, it just doesnt show because its hidden
(polymorphism?).
if you add new code it iwll execute the code you put in the original and

the
new one.

if i undrestand your question right then thats the answer.
"RD" <di******@alltel.net> wrote in message news:5SEHb.10$TJ.4@fe01...
I created a base form with couple of buttons and wrote some code in the button_click.

Then I inherited this form and created another one .
But I am not able to add more code into the button_click in the new form (or I am not able to see the code).

Is it possible? If so how?

Thanks



Nov 15 '05 #4
RD <di******@alltel.net> wrote:
Still I have doubts.
Base code is not showing because of "Polymorphism". That part is clear
now.

But I am not able to see the "button_click()" module to write more code
into it (in the new form) .
Do I have to do any property setting to see the module?


It's not a module - it's a method. You can't just "write more code into
it" - but what you *can* do (if it's a virtual method) is override it,
and call the base version either at the start or the end of your
method.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5
Jax
Just to make sure, the button event isn't private is it?
If so it needs to be protected or public.

Nov 15 '05 #6

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

Similar topics

0
by: Hemraj Julha | last post by:
Hi (Sorry if this appears twice but I posted this yersterday and I can't see it in the forum today) I'm trying "Visual Inheritance" in C# and facing an issue which might be related to my...
1
by: Hemraj Julha | last post by:
Hi I'm trying "Visual Inheritance" in C# and facing an issue which might be related to my ignorance about namespaces and location of the source code within the folders so I'll try to explain my...
3
by: Peter Cresswell | last post by:
Hi guys/gals, I'm using VS.net 2003 and having trouble with the following: I am trying to inherit a base class into a web form, but VS will then not allow me to add any ASP.NET controls using...
0
by: Frnak McKenney | last post by:
I'm running into problems with VisualStudio.NET2003 and Windows Forms inheritance. It _feels_ like a bug, but it could just as well be a misunderstanding on my part regarding how the VS Designer...
11
by: PAul Maskens | last post by:
The form designer adds unnecessary code to the section when using a subclassed control. I've reproduced this in VS.NET 2002 and VS.NET 2003 so it's pretty fundamental. Outline steps: Create a...
13
by: Just Me | last post by:
I have two forms. Each contains a property, say Prop. I do Public FormBeingUsed as Form .. .. .. Then I do FormBeingUsed= Form1 or maybe
4
by: Alan T | last post by:
How do I create a form inherited from an existing form in the same project ?
4
by: Mikus Sleiners | last post by:
I can't seem to add new controls to form that is inherited from another form. I have BaseForm wich have table layout on it 2 panelsm and some buttons. Now i create InheritedForm : BaseForm and...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
7
by: ademirzanetti | last post by:
Hi there !!! I would like to listen your opinions about inherit from a STL class like list. For example, do you think it is a good approach if I inherit from list to create something like...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.