private void tbrFont_Click(object sender, EventArgs e)
        {
            if (m_mailTemplate == null)
            {
                return;
            }

            try
            {
                if (!(rtbDoc.Font == null))
                {
                    FontDialog1.Font = rtbDoc.SelectionFont;
                }
                else
                {
                    FontDialog1.Font = null;
                }
                FontDialog1.ShowApply = true;

                if (FontDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    rtbDoc.SelectionFont = FontDialog1.Font;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Error");
            }
        }
Beispiel #2
0
 private void SelectFontToolStripMenuItem_Click(object sender,
                                                System.EventArgs e)
 {
     try
     {
         if (!(rtbDoc.SelectionFont == null))
         {
             FontDialog1.Font = rtbDoc.SelectionFont;
         }
         else
         {
             FontDialog1.Font = null;
         }
         FontDialog1.ShowApply = true;
         if (FontDialog1.ShowDialog() ==
             System.Windows.Forms.DialogResult.OK)
         {
             rtbDoc.SelectionFont = FontDialog1.Font;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString(), "Error");
     }
 }
Beispiel #3
0
 private void btnFont_Click(System.Object sender, System.EventArgs e)
 {
     FontDialog1.ShowColor     = true;
     FontDialog1.ShowEffects   = true;
     FontDialog1.FontMustExist = true;
     FontDialog1.ShowDialog();
 }
Beispiel #4
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            DialogResult fontResult = FontDialog1.ShowDialog();

            if (fontResult == DialogResult.OK)
            {
                textoTbx.Font = FontDialog1.Font;
            }
        }
Beispiel #5
0
 private void FontButton_Click(object sender, EventArgs e)
 {
     //Padarome antra mygtuka spalvai pasirinkti
     if (FontDialog1.ShowDialog() == DialogResult.OK)
     {
         Font1           = FontDialog1.Font;
         FontButton.Text = Font.Name;
     }
 }
Beispiel #6
0
 private void SelectFontToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         FontDialog1.Font      = rtbDoc.SelectionFont;
         FontDialog1.ShowApply = true;
         if (FontDialog1.ShowDialog() == DialogResult.OK)
         {
             rtbDoc.SelectionFont = FontDialog1.Font;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error");
     }
 }
Beispiel #7
0
        private void fontToolStripMenuItem_Click(object sender, EventArgs e)
        {
            {
                // Set FontMustExist to true, which causes message box error
                // if the user enters a font that does not exist.
                FontDialog1.FontMustExist = true;

                // Associate the method handling the Apply event with the event.
                FontDialog1.Apply += new System.EventHandler(FontDialog1_Apply);

                // Show the Apply button in the dialog.
                FontDialog1.ShowApply = true;

                // Do not show effects such as Underline
                // and Bold.
                FontDialog1.ShowEffects = false;

                // Save the existing font.
                System.Drawing.Font oldFont = this.Font;

                //Show the dialog, and get the result
                DialogResult result = FontDialog1.ShowDialog();

                // If the OK button in the Font dialog box is clicked,
                // set all the controls' fonts to the chosen font by calling
                // the FontDialog1_Apply method.
                if (result == DialogResult.OK)
                {
                    FontDialog1_Apply(this.rtb, new System.EventArgs());
                }
                // If Cancel is clicked, set the font back to
                // the original font.
                else if (result == DialogResult.Cancel)
                {
                    this.Font = oldFont;
                    foreach (Control containedControl in this.Controls)
                    {
                        containedControl.Font = oldFont;
                    }
                }
            }
        }
Beispiel #8
0
 private void btFont_Click(object sender, EventArgs e)
 {
     FontDialog1.ShowDialog();
 }