Templates color for forms

jessiang

Member
Joined
Jun 6, 2006
Messages
8
Programming Experience
Beginner
i want to do templates to change the form's background color.eg:if i choose white color then all the form's background color is white and the font will be black color. i know the web application can do it, but i don't know how to start if for the window form. can anyone help me how to start it?thanks
 
Create a form and set it up, this is your template. You could name it 'frmTemplate'.

Create a new form, go to its Form.Designer.vb file and change the default inherits statement from System.Windows.Forms.Form to your template form. Show all files in Solution Explorer to see the Form.Designer.vb file, it's a partial class linked to the form, if you click '+' at the form it is linked just below it in the tree. See screenshot.

This is the code before you change it:
VB.NET:
Partial Class frmMyForm
Inherits System.Windows.Forms.Form

This is the code after you change it:
VB.NET:
Partial Class frmMyForm
Inherits [B]frmTemplate[/B]
 

Attachments

  • partial.jpg
    partial.jpg
    11.3 KB · Views: 26
Back
Top