示例#1
0
        public FormOpenFontDialog()
        {
            InitializeComponent();

            string[] fontSizeList  = FormFontViewer.getFontSizeList();
            string   prevFontSize  = null;
            Size     radioSize     = new Size(120, 30);
            int      radioOriX     = 25;
            Point    radioLocation = new Point(radioOriX, 30);

            foreach (string fontSize in fontSizeList)
            {
                if (prevFontSize == null)
                {
                    prevFontSize = fontSize.Substring(0, 2);
                }
                else if (fontSize.Substring(0, 2) != prevFontSize)
                {
                    radioLocation.Y += radioSize.Height;
                    radioLocation.X  = radioOriX;
                    prevFontSize     = fontSize.Substring(0, 2);
                }

                RadioButton radio = new RadioButton();
                radio.Text            = fontSize;
                radio.Location        = radioLocation;
                radio.CheckedChanged += new System.EventHandler(this.radio_CheckedChanged);
                this.groupBox1.Controls.Add(radio);

                radioLocation.X += radioSize.Width;
            }
        }
示例#2
0
 /// <summary>
 /// Show form font viewer
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripButtonFontViewer_Click(object sender, EventArgs e)
 {
     using (FormFontViewer form = new FormFontViewer())
     {
         this.Hide();
         form.ShowDialog();
         this.Show();
     }
 }
示例#3
0
 /// <summary>
 /// Show form font viewer
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripButtonFontViewer_Click(object sender, EventArgs e)
 {
     using (FormFontViewer form = new FormFontViewer())
     {
         this.Hide();
         form.ShowDialog();
         this.Show();
     }
 }