System Fonts: Icon Title Font : Font « GUI Windows Form « C# / C Sharp






System Fonts: Icon Title Font

System Fonts: Icon Title Font

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

public class Form1 : Form
{
    private System.Windows.Forms.Label label2;
    
  public Form1() {
        this.Font = SystemFonts.IconTitleFont;
        this.AutoScaleDimensions = new System.Drawing.SizeF(6.0F, 13.0F);
        InitializeComponent();
        SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
  }

    private void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
    {
        if (e.Category == UserPreferenceCategory.Window)
        {
            this.Font = SystemFonts.IconTitleFont;
        }
    }

    private void InitializeComponent()
    {
        this.label2 = new System.Windows.Forms.Label();
        this.SuspendLayout();
        // 
        // label2
        // 
        this.label2.Location = new System.Drawing.Point(12, 9);
        this.label2.Name = "label2";
        this.label2.Size = new System.Drawing.Size(220, 55);
        this.label2.TabIndex = 2;
        this.label2.Text = "Try changing the Small Fonts/Large Fonts setting for th" +
            "e computer.";
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(244, 138);
        this.Controls.Add(this.label2);
        this.Text = "Form1";
        this.ResumeLayout(false);

    }
  [STAThread]
  static void Main()
  {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
  }

}


           
       








Related examples in the same category

1.All font properties
2.new Font("Times New Roman", 10, FontStyle.Italic)
3.new Font(strFont, fSize)
4.new Font(fontRegular, FontStyle.Italic);
5.Text on Baseline
6.Font: SizeInPoints
7.Font with different size
8.Font: GetHeight
9.Load all system installed fontsLoad all system installed fonts
10.Timer based animation for fontTimer based animation for font
11.Get all system installed fontGet all system installed font
12.Font listFont list