Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/11/2009, 19:57
NJCalvo
 
Fecha de Ingreso: octubre-2008
Mensajes: 148
Antigüedad: 16 años, 4 meses
Puntos: 7
Ayuda con editor de textos! Darle formato al texto

Hola, estoy haciendo un editor de textos con VB.NET .
Mi problema es para darle formato al texto, utilizo el siguiente código:
Código:
        If RTB.SelectionFont IsNot Nothing Then
            Dim currentFont As System.Drawing.Font = RTB.SelectionFont
            Dim newFontStyle As System.Drawing.FontStyle

            If RTB.SelectionFont.Bold = True Then
                newFontStyle = FontStyle.Regular
                NegritaBarraFormato.Checked = False
            Else
                newFontStyle = FontStyle.Bold
                NegritaBarraFormato.Checked = True
            End If

            RTB.SelectionFont = New Font( _
               currentFont.FontFamily, _
               currentFont.Size, _
               newFontStyle _
            )
        End If
(este es el de negrita, aunque con el de subrayar y de cursiva son similares)
Pero al seleccionar, por ejemplo, negrita, escribo algo y despues selecciono cursiva se me sale la negrita y se queda con cursiva sola!
Ah, otro de mis problemas es como poner en un Combobox para elegir la fuente y el tamaño.
Desde ya muchas gracias!
__________________
Noticias sobre Informatica