11 Mayıs 2012 Cuma

C# ILE FONT İŞLEMI



private void button1_Click(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Red;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Yellow;
}
private void button4_Click(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Blue;
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Green;
}
private void button5_Click(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Orange;
}
private void button6_Click(object sender, EventArgs e)
{
textBox1.ForeColor = Color.Pink;
}
private void button9_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void Form1_Load(object sender, EventArgs e)
{
numericUpDown1.Maximum = 36 ;
numericUpDown1.Increment = 2;
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
textBox1.Font = new Font(textBox1.Font.FontFamily, (float)numericUpDown1.Value);
}
private void comboBox1_TextChanged(object sender, EventArgs e)
{
try
{
string w = numericUpDown1.Value.ToString();
int byut = Convert.ToInt32(w);
if (comboBox1.SelectedIndex == 0)
{
textBox1.Font = new Font(“Times New Roman”, byut, FontStyle.Regular);
}
if (comboBox1.SelectedIndex == 1)
{
textBox1.Font = new Font(“Calibri”, byut, FontStyle.Regular);
}
if (comboBox1.SelectedIndex == 2)
{
textBox1.Font = new Font(“Arial”, byut, FontStyle.Regular);
}
}
catch
{
}
}
private void button7_Click(object sender, EventArgs e)
{
textBox1.TextAlign = HorizontalAlignment.Right;
}
private void button8_Click(object sender, EventArgs e)
{
textBox1.TextAlign = HorizontalAlignment.Center;
}
private void button10_Click(object sender, EventArgs e)
{
textBox1.TextAlign = HorizontalAlignment.Left;
}

Hiç yorum yok:

Yorum Gönder