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
 
Back
Top