WPF. Is there a dialog window for selecting a font in WPF? [duplicate]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-3
















This question already has an answer here:




  • How to open Color and Font Dialog box using WPF?

    2 answers




Is there a dialog window for selecting a font in WPF? How to put the selected font to TextBox?










share|improve this question













marked as duplicate by Rufus L c#
Users with the  c# badge can single-handedly close c# questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 3 at 20:29


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

























    -3
















    This question already has an answer here:




    • How to open Color and Font Dialog box using WPF?

      2 answers




    Is there a dialog window for selecting a font in WPF? How to put the selected font to TextBox?










    share|improve this question













    marked as duplicate by Rufus L c#
    Users with the  c# badge can single-handedly close c# questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Jan 3 at 20:29


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      -3












      -3








      -3









      This question already has an answer here:




      • How to open Color and Font Dialog box using WPF?

        2 answers




      Is there a dialog window for selecting a font in WPF? How to put the selected font to TextBox?










      share|improve this question















      This question already has an answer here:




      • How to open Color and Font Dialog box using WPF?

        2 answers




      Is there a dialog window for selecting a font in WPF? How to put the selected font to TextBox?





      This question already has an answer here:




      • How to open Color and Font Dialog box using WPF?

        2 answers








      c# wpf textbox






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 3 at 20:18









      YaroslavYaroslav

      12




      12




      marked as duplicate by Rufus L c#
      Users with the  c# badge can single-handedly close c# questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Jan 3 at 20:29


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Rufus L c#
      Users with the  c# badge can single-handedly close c# questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Jan 3 at 20:29


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          1 Answer
          1






          active

          oldest

          votes


















          0














          Yes its called FontDialog. Below is a sample code for opening a fontdialogbox with a button click.



          using System;
          using System.Drawing;
          using System.Windows.Forms;

          namespace WindowsFormsApplication1
          {
          public partial class Form1 : Form
          {
          public Form1()
          {
          InitializeComponent();
          }

          private void button1_Click(object sender, EventArgs e)
          {
          // Show the dialog.
          DialogResult result = fontDialog1.ShowDialog();
          // See if OK was pressed.
          if (result == DialogResult.OK)
          {
          // Get Font.
          Font font = fontDialog1.Font;
          // Set TextBox properties.
          this.textBox1.Text = string.Format("Font: {0}", font.Name);
          this.textBox1.Font = font;
          }
          }
          }
          }





          share|improve this answer
























          • Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

            – Yaroslav
            Jan 3 at 20:31


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Yes its called FontDialog. Below is a sample code for opening a fontdialogbox with a button click.



          using System;
          using System.Drawing;
          using System.Windows.Forms;

          namespace WindowsFormsApplication1
          {
          public partial class Form1 : Form
          {
          public Form1()
          {
          InitializeComponent();
          }

          private void button1_Click(object sender, EventArgs e)
          {
          // Show the dialog.
          DialogResult result = fontDialog1.ShowDialog();
          // See if OK was pressed.
          if (result == DialogResult.OK)
          {
          // Get Font.
          Font font = fontDialog1.Font;
          // Set TextBox properties.
          this.textBox1.Text = string.Format("Font: {0}", font.Name);
          this.textBox1.Font = font;
          }
          }
          }
          }





          share|improve this answer
























          • Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

            – Yaroslav
            Jan 3 at 20:31
















          0














          Yes its called FontDialog. Below is a sample code for opening a fontdialogbox with a button click.



          using System;
          using System.Drawing;
          using System.Windows.Forms;

          namespace WindowsFormsApplication1
          {
          public partial class Form1 : Form
          {
          public Form1()
          {
          InitializeComponent();
          }

          private void button1_Click(object sender, EventArgs e)
          {
          // Show the dialog.
          DialogResult result = fontDialog1.ShowDialog();
          // See if OK was pressed.
          if (result == DialogResult.OK)
          {
          // Get Font.
          Font font = fontDialog1.Font;
          // Set TextBox properties.
          this.textBox1.Text = string.Format("Font: {0}", font.Name);
          this.textBox1.Font = font;
          }
          }
          }
          }





          share|improve this answer
























          • Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

            – Yaroslav
            Jan 3 at 20:31














          0












          0








          0







          Yes its called FontDialog. Below is a sample code for opening a fontdialogbox with a button click.



          using System;
          using System.Drawing;
          using System.Windows.Forms;

          namespace WindowsFormsApplication1
          {
          public partial class Form1 : Form
          {
          public Form1()
          {
          InitializeComponent();
          }

          private void button1_Click(object sender, EventArgs e)
          {
          // Show the dialog.
          DialogResult result = fontDialog1.ShowDialog();
          // See if OK was pressed.
          if (result == DialogResult.OK)
          {
          // Get Font.
          Font font = fontDialog1.Font;
          // Set TextBox properties.
          this.textBox1.Text = string.Format("Font: {0}", font.Name);
          this.textBox1.Font = font;
          }
          }
          }
          }





          share|improve this answer













          Yes its called FontDialog. Below is a sample code for opening a fontdialogbox with a button click.



          using System;
          using System.Drawing;
          using System.Windows.Forms;

          namespace WindowsFormsApplication1
          {
          public partial class Form1 : Form
          {
          public Form1()
          {
          InitializeComponent();
          }

          private void button1_Click(object sender, EventArgs e)
          {
          // Show the dialog.
          DialogResult result = fontDialog1.ShowDialog();
          // See if OK was pressed.
          if (result == DialogResult.OK)
          {
          // Get Font.
          Font font = fontDialog1.Font;
          // Set TextBox properties.
          this.textBox1.Text = string.Format("Font: {0}", font.Name);
          this.textBox1.Font = font;
          }
          }
          }
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 20:23









          Shiva2794Shiva2794

          397




          397













          • Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

            – Yaroslav
            Jan 3 at 20:31



















          • Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

            – Yaroslav
            Jan 3 at 20:31

















          Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

          – Yaroslav
          Jan 3 at 20:31





          Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"

          – Yaroslav
          Jan 3 at 20:31





          Popular posts from this blog

          Mossoró

          Can't read property showImagePicker of undefined in react native iOS

          Pushsharp Apns notification error: 'InvalidToken'