fonts

  • Thread starter Thread starter David Sobey
  • Start date Start date
D

David Sobey

anyone know a simple way to make a font property persist for a custom
control?

cheers
dave
 
In the constructor set the font for the control and override the font
property and leave out the setter.

public MyTextBox()
{
InitializeComponent();
}

public override Font Font
{
get
{
return base.Font;
}
}

private void InitializeComponent()
{
this.Name = "MyTextBox";
this.Font = new Font("Tahoma",8);
}

Gabriel Lozano-Morán
 

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

Similar Threads

Happy Birthday bodhi 6
Happy Birthday BigJay 3
Happy Birthday @Ian 7
Happy Birthday TriplexDread 5
Happy Birthday Ian 4
Happy Birthday Quadophile 8
Happy Birthday Muckshifter 6
Happy Birthday Ian 16

Back
Top