在C#Windows Applicatin中继承 [英] inheritace in C# windows applicatin

查看:103
本文介绍了在C#Windows Applicatin中继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我正在寻找继承,方法重写示例,其中C#Windows应用程序中的代码不在控制台应用程序中,
如果有任何链接或想法,请帮助我

谢谢与问候
Indrajit Dasgupta

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

推荐答案

Windows窗体用于用户界面.
继承,方法重写是概念.这与您在Windows或控制台应用程序中使用的情况无关.它们具有相同的方法
如果您在Windows应用程序中看到继承,请
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,
public partial class Form1 : Form


Form1继承Form类.
看到这个例子
覆盖
现在不要写这个


The Form1 inherits Form class.
See this example
Override
now instead of writting this

Console.WriteLine("Area of the square = {0}", sq.Area());


取值并分配给Windows窗体中的文本框.
这将是Windows应用程序的问题.


take value and assign to a textbox in Windows Form.
That will be Overriing with windows application


您可以看一个继承Form本身的示例-请参阅http://msdn.microsoft.com/en-us/library/5h0k2e6x.aspx [如何:从现有Windows窗体控件继承 [
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.


这篇关于在C#Windows Applicatin中继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆