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!