[英]Standarized Forms C# with inheritance
I'm making an application for a touchscreen-computer-scanner CK3; 我正在为触摸屏计算机扫描仪CK3申请; I made several standardized forms(list, detail, dialog) and I made em inherit from a Class I made that is inheriting from the Form class. 我制作了几种标准化的表单(列表,详细信息,对话框),并且使em继承自从Form类继承的类。
public class Formulier : Form
{
private const int WIDTH = 248;
private const int HEIGHT = 328;
public Formulier()
{
this.Font = new Font("Microsoft Sans Serif", 10f);
//this.Height = HEIGHT;
//this.Width = WIDTH;
//this.MinimumSize = new Size(Width, Height);
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
}
}
namespace WarehouseManagement {
public partial class FormPikbonDetail : Formulier {
public FormPikbonDetail() {
InitializeComponent();
}
}
}
It worked fine for the Font and the FormBorderStyle but the WindowState didn't get maximized. 对于Font和FormBorderStyle来说效果很好,但是WindowState并未最大化。 What am I doing wrong here? 我在这里做错了什么?
Change the WindowState after the form is actually really created - constructor is too early. 在实际创建表单后更改WindowState-构造函数为时过早。 By BrokenGlass 由BrokenGlass
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.