using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp37
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Graphics formgraphics = this.CreateGraphics();
formgraphics.Clear(SystemColors.Control);
string drawString = "Örnek yazı";
SolidBrush drawBrush = new SolidBrush(Color.Black);
Font drawFont = new Font(listBox1.Text, 20, FontStyle.Bold | FontStyle.Italic);
formgraphics.DrawString(drawString, drawFont, drawBrush, 40, 50);
drawFont.Dispose();
drawBrush.Dispose();
formgraphics.Dispose();
}
private void Form1_Load(object sender, EventArgs e)
{
foreach (FontFamily fonts in FontFamily.Families)
{
listBox1.Items.Add(fonts.Name);
}
}
}
}
Hiç yorum yok:
Yorum Gönder