0

Is there a way to set similar fonts for all the similar type of controls of Windows Forms appearing in a project.

For e.g I want to set all the textboxes in project to Arial Black 10pt Regular and all the labels to Arial Black 10pt Bold, so on and so forth.

Thanks in advance

Marshal
  • 6,551
  • 13
  • 55
  • 91
  • 1
    Avoid your users hating you, let the OS default the font, and font-size. In short: Don't edit anything but the style (Bold/Normal). – Claus Jørgensen Apr 05 '11 at 08:41
  • @Claus: I want to use special UI Fonts (Segoe UI) which makes the application look much better. You are right that I must not irritate user by using **too fancy** fonts – Marshal Apr 05 '11 at 08:43
  • possible duplicate of [how do i get the collection of components placed on the form to change their font](http://stackoverflow.com/questions/5549108/how-do-i-get-the-collection-of-components-placed-on-the-form-to-change-their-font) – Daniel Hilgarth Apr 05 '11 at 08:44
  • 2
    @Niraj: Your notion of "better looking" is completely subjective. That's what computer settings are for: Configure your computer to use that font as the default font and give other users the same freedom. – Daniel Hilgarth Apr 05 '11 at 08:44
  • @Daniel: Point to be noted. Thanks – Marshal Apr 05 '11 at 08:46
  • 1
    Windows Forms in VS2008 DO NOT use the system font by default - see http://stackoverflow.com/questions/297701/default-font-for-windows-forms-application – stuartd Apr 05 '11 at 09:49
  • @Stuart Oh, One gets to use to the awesomeness of WPF, I guess ;) – Claus Jørgensen Apr 05 '11 at 12:03

1 Answers1

0

1: Create a Base Control that inherits from TextBox.

Then make all your controls inherit from it.

2: Make a Base Form that inherits from Form.

Make a simple loop in the beginning that loops through all the controls in the form recursively, and changes the font.

Then make all your forms inherit from that base form.

Yochai Timmer
  • 48,127
  • 24
  • 147
  • 185