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.
精彩评论