Click here to Skip to main content
15,898,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I am looking for inheritance, Method Overriding example with code in C# Windows application not in Console application
If any has link or idea please help me

Thanks & Regards
Indrajit Dasgupta
Posted

Windows Forms are for User Interface.
inheritance, Method Overriding are concepts.This is not matter you used in Windows or console application.They have same approch
If you see inheritence in windows application,
C#
public partial class Form1 : Form

The Form1 inherits Form class.
See this example
Override
now instead of writting this
C#
Console.WriteLine("Area of the square = {0}", sq.Area());

take value and assign to a textbox in Windows Form.
That will be Overriing with windows application
 
Share this answer
 
Comments
lukeer 16-Dec-11 4:22am    
5 for differentiating between UI and concepts
uspatel 16-Dec-11 4:30am    
thanks lukeer.
You can look at an example in which the Form itself is inherited - see http://msdn.microsoft.com/en-us/library/5h0k2e6x.aspx[^].

How to: Inherit from Existing Windows Forms Controls[^] should help you as well.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900