如何使用c#为所有表单定义基本表单样式? [英] how can I define a base form style for all forms using c#?
本文介绍了如何使用c#为所有表单定义基本表单样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c#为所有表单定义基本表单样式?
例如:一个银行应用程序的所有表格都包含相同的背景,并且在背景中,我们有一个银行图像需要全部使用.
我知道使用Masterpages在asp.net中进行处理.寻找一些在C#.Net中实现它的概念.
how can I define a base form style for all forms using c#?
For example: an banking application containing same background for all the forms and in the background we have an bank image which need to be used in all.
I know processing in asp.net by using Masterpages. Looking some conept implementing it in C#.Net.
推荐答案
基本上,您将以所需的方式创建表单(称为BaseForm),然后在添加时一个新窗体,导航到继承的窗体",然后选择基本窗体".
基本形式...
Basically you would create your form in the way you wanted it, (call it BaseForm) and then when you add a new form, navigate to Inherited form, and select baseform.
Base form...
public partial class BaseForm : Form
{
protected BaseForm()
{
InitializeComponent();
}
}
现在,Single Entry From继承了它.
And now the Single Entry From that inherits it.
public partial class SingleEntry : BaseForm
{
protected SingleEntry()
{
InitializeComponent();
}
}
这篇关于如何使用c#为所有表单定义基本表单样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文