Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/12/2008, 13:35
Eze_carpe_diem
 
Fecha de Ingreso: diciembre-2008
Mensajes: 5
Antigüedad: 15 años, 5 meses
Puntos: 0
Manejo de strings con C#

Buenas, espero me puedan ayudar.
Estoy haciendo un user control que tendra las funciones de la toolbar de edicion de texto del word.
hasta ahora hice esto:

private void btnBold_Click(object sender, EventArgs e)
{

if (txtTexto.SelectionFont.Bold)
{
txtTexto.SelectionFont. = new System.Drawing.Font("Arial", 10, FontStyle.Regular);
}
else
{
txtTexto.SelectionFont = new System.Drawing.Font("Arial", 10, FontStyle.Bold );
}

}

private void btnItalic_Click(object sender, EventArgs e)
{

if (txtTexto.SelectionFont.Italic)
{
txtTexto.SelectionFont = new System.Drawing.Font("Arial", 10, FontStyle.Regular);
}
else
{
txtTexto.SelectionFont = new System.Drawing.Font("Arial", 10, FontStyle.Italic);
}

}

El problema es que funcionan bien por separado digamos, pero no puedo por ejemplo que la fuente este en kursiva y negrita a la vez. solo es un , otra o normal =S.

si alguien me da una manito se los agradecere mucho, y si quieren colaborar con los botones copiar, pegar, cortar y alinear no me enojo =P

Gracias por su tiempo

P.D.: si conocen algu addin o pluggin de alguna toolbar existente avisenme tmb por favor.