开发者

Visual Inheritance

I have same settings for 开发者_运维百科all of my forms for example color , font , align, etc How can i do these settings for one form and inheriting it on all forms. thanks. Edition 1 : i am using Windows Forms.


One way would be to extend/inherit from the form class, set the properties the way you like in your constructor, and let your forms inherit from that class.

Something like:

class RedForm : Form
{
    public RedForm() { BackColor = Color.Red; }
}

and then make your forms based on RedForm rather than Form.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜