Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

WinForm Style Sheet

, 22 Jun 2004
An article on setting styles for Windows applications.
winformstylesheet_src.zip
WinformCSS
MyWinApp
App.ico
bin
Debug
obj
Debug
temp
TempPE
WinCSS
bin
Debug
obj
Debug
temp
TempPE
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace MyWinApp
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private WinCSS.ErrorLabel errorLabel1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.errorLabel1 = new WinCSS.ErrorLabel();
			this.SuspendLayout();
			// 
			// errorLabel1
			// 
			this.errorLabel1.AutoSize = true;
			this.errorLabel1.Font = new System.Drawing.Font("Verdana", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.errorLabel1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(0)), ((System.Byte)(0)));
			this.errorLabel1.Location = new System.Drawing.Point(80, 72);
			this.errorLabel1.Name = "errorLabel1";
			this.errorLabel1.Size = new System.Drawing.Size(95, 19);
			this.errorLabel1.TabIndex = 0;
			this.errorLabel1.Text = "errorLabel1";
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(472, 273);
			this.Controls.Add(this.errorLabel1);
			this.Name = "Form1";
			this.Text = "Form1";
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			this.Refresh();
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Ali Zolghadri
Architect
Canada Canada
I worked for the software industry as a software architect, system analyst, senior software engineer and MIS (management information system) consultant for last 10 years.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 23 Jun 2004
Article Copyright 2004 by Ali Zolghadri
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid