Propiedad Font.

29/09/2004 - 20:26 por miguel Arenas | Informe spam
Como cambio la propiedad label1.fond.Bold=true desde
codigo, marca el error de propiedad solo lectura.
gracias.

Preguntas similare

Leer las respuestas

#1 Eduardo A. Morcillo [MS MVP VB]
29/09/2004 - 20:39 | Informe spam
Como cambio la propiedad label1.fond.Bold=true desde
codigo, marca el error de propiedad solo lectura.



Debes crear un nuevo Font y asignarlo a la propiedad. Por ejemplo:

Label1.Font = New Font(Label1.Font, FontStyle.Bold)

Eduardo A. Morcillo [MS MVP VB]
http://www.mvps.org/emorcillo
Respuesta Responder a este mensaje
#2 Miguel Arenas
29/09/2004 - 20:48 | Informe spam
Gracias.
Respuesta Responder a este mensaje
#3 Miguel Arenas
29/09/2004 - 21:15 | Informe spam
Y como hago para para que no elimine los propiedades que
ya tenia establecidas en el Font. Por ejemplo.
Si LblFont.font.bold=true en tiempo de diseño, y despues
en el codigo tengo lblfont.Font = New Font(lblfont.Font,
FontStyle.Italic), quita el Bold y Pone Italic=true.
Gracias.
Respuesta Responder a este mensaje
#4 Jorge Serrano [MVP VB]
29/09/2004 - 21:29 | Informe spam
Hola Miguel,

para eso debes conjugar las propiedades, es decir:

Label1.Font = New Font(Label1.Font, FontStyle.Bold Or FontStyle.Italic)

Un saludo,

Jorge Serrano Pérez
Microsoft MVP VB.NET
PortalVB.com
http://www.portalvb.com/
Weblog de Jorge Serrano
http://weblogs.golemproject.com/jorge/
No te olvides de:
http://www.microsoft.com/spanish/ms...des/vbnet/

Frase: "Si le das pescado a un hombre hambriento, le nutres durante una
jornada. Si le enseñas a pescar, le nutrirás toda su vida." Lao-Tsé - 600 AC
[aprox]



"Miguel Arenas" escribió en el mensaje
news:033801c4a658$9fa43c10$
Y como hago para para que no elimine los propiedades que
ya tenia establecidas en el Font. Por ejemplo.
Si LblFont.font.bold=true en tiempo de diseño, y despues
en el codigo tengo lblfont.Font = New Font(lblfont.Font,
FontStyle.Italic), quita el Bold y Pone Italic=true.
Gracias.
Respuesta Responder a este mensaje
#5 Miguel Arenas
29/09/2004 - 21:55 | Informe spam
Si asi lo estoy haciedo pero no lo esta tomando. Esta es
la intruccion.


If (Not rtbNote.SelectionFont.Italic) And
rtbNote.SelectionFont.Bold And
rtbNote.SelectionFont.Underline Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Italic Or FontStyle.Bold Or FontStyle.Underline)
End If
If (Not rtbNote.SelectionFont.Italic) And
rtbNote.SelectionFont.Bold And (Not
rtbNote.SelectionFont.Underline) Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Italic Or FontStyle.Bold)
End If
If (Not rtbNote.SelectionFont.Italic) And
(Not rtbNote.SelectionFont.Bold) And
rtbNote.SelectionFont.Underline Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Italic Or FontStyle.Underline)
End If
If (Not rtbNote.SelectionFont.Italic) And
(Not rtbNote.SelectionFont.Bold) And (Not
rtbNote.SelectionFont.Underline) Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Italic)
End If


If rtbNote.SelectionFont.Italic And
rtbNote.SelectionFont.Bold And
rtbNote.SelectionFont.Underline Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Bold Or FontStyle.Underline)
End If
If rtbNote.SelectionFont.Italic And
rtbNote.SelectionFont.Bold And (Not
rtbNote.SelectionFont.Underline) Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Bold)
End If
If rtbNote.SelectionFont.Italic And (Not
rtbNote.SelectionFont.Bold) And
rtbNote.SelectionFont.Underline Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Underline)
End If
If rtbNote.SelectionFont.Italic And (Not
rtbNote.SelectionFont.Bold) And (Not
rtbNote.SelectionFont.Underline) Then
lblfont.Font = New Font(lblfont.Font,
FontStyle.Regular)
End If
Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaSiguiente Respuesta Tengo una respuesta
Search Busqueda sugerida