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;
}
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?
c# wpf textbox
marked as duplicate by Rufus L
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.
add a comment |
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?
c# wpf textbox
marked as duplicate by Rufus L
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.
add a comment |
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?
c# wpf textbox
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
c# wpf textbox
asked Jan 3 at 20:18
YaroslavYaroslav
12
12
marked as duplicate by Rufus L
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
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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;
}
}
}
}
Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"
– Yaroslav
Jan 3 at 20:31
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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;
}
}
}
}
Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"
– Yaroslav
Jan 3 at 20:31
add a comment |
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;
}
}
}
}
Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"
– Yaroslav
Jan 3 at 20:31
add a comment |
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;
}
}
}
}
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;
}
}
}
}
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
add a comment |
Its in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"
– Yaroslav
Jan 3 at 20:31
It
s in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"– Yaroslav
Jan 3 at 20:31
It
s in Windows Forms. I asked about wpf. In wpf I didnt find class "FontDialog"– Yaroslav
Jan 3 at 20:31
add a comment |