A Continuación os pongo el código completo. Como en las imágenes esta todo bien comentado y marcado. No veo que haga falta mayores explicaciones.
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 etiqueta_8._6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Menu
//Salir
private void salirToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
//Tamaño
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font.FontFamily, 12F);
}
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font.FontFamily, 14F);
}
private void toolStripMenuItem4_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font.FontFamily, 16F);
}
private void toolStripMenuItem5_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font.FontFamily, 18F);
}
private void toolStripMenuItem6_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font.FontFamily, 20F);
}
//estilo
//negrita
private void negritaToolStripMenuItem_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font, etiqueta.Font.Style ^ FontStyle.Bold);
}
//cursiva
private void cursivaToolStripMenuItem_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font, etiqueta.Font.Style ^ FontStyle.Italic);
}
//subrayado
private void subrayadoToolStripMenuItem_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font, etiqueta.Font.Style ^ FontStyle.Underline);
}
//letra
private void arialToolStripMenuItem_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font("Arial", etiqueta.Font.Size);
}
private void timesNewRomanToolStripMenuItem_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font("Times New Roman", etiqueta.Font.Size);
}
private void courierNewToolStripMenuItem_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font("Courier New", etiqueta.Font.Size);
}
//Barra de herramientas
//negirta
private void btnNegrita_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font, etiqueta.Font.Style ^ FontStyle.Bold);
}
private void btnCursiva_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font, etiqueta.Font.Style ^ FontStyle.Italic);
}
private void btnSubrayado_Click(object sender, EventArgs e)
{
etiqueta.Font = new Font(etiqueta.Font, etiqueta.Font.Style ^ FontStyle.Underline);
}
}
}
0 comentarios:
Publicar un comentario