how to change the default properties of textbox

N

newbies

I have several textbox which have a different background color and font
type/size as the default textbox. How do I change the default background and
font size so that I do not need to change each individual textbox property?
Can someone share with me the steps in achieving this? I'm using Visual
studio 2008 and new to c#
 
N

newbies

yes it is for windows form application and I am not using wpf.
Anyone any suggestion/ideas?
 
N

newbies

Hi Peter,
I've created a textbox class and compiled it. However when I drop the newly
created control from the toolbox to a form it still has the default textbox
font type and size instead of the customised font type. What could be
missing? The code for the class is below:

namespace stdformtemplate
{
public class ucTextbox : TextBox
{

private void InitializeComponent()
{
this.SuspendLayout();
//
// ucTextbox
//
this.Font = new System.Drawing.Font("Verdana", 12F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((byte)(0)));
this.ResumeLayout(false);

}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top