RichTextBox!

22/09/2003 - 19:19 por Carlos Marín | Informe spam
HOLA!

¿Cómo se puede justificar un párrafo contenido en un RichTextBox? ¿Hay
alguna página donde se muestre un ejemplo?

Gracias y Saludos!

Preguntas similare

Leer las respuestas

#1 elenaar
22/09/2003 - 22:38 | Informe spam
Creo que puedes usar la propiedad RichTextBox.RightMargin Property, en
ayuda busca por RichTextBox y en propiedades busca por RightMargin, te da
un ejemplo de como usar la propiedad.
Private Sub ZoomMyRichTextBox()
' Enable users to select entire word when double clicked.
richTextBox1.AutoWordSelection = True
' Clear contents of control.
richTextBox1.Clear()
' Set the right margin to restrict horizontal text.
richTextBox1.RightMargin = 2
' Set the text for the control.
richTextBox1.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot"
' Zoom by 2 points.
richTextBox1.ZoomFactor = 2.0F
End Sub


Elena Arzac
Respuesta Responder a este mensaje
#2 Carlos Marín
22/09/2003 - 23:32 | Informe spam
HOLA ELENA!

Me refería a la propiedad SelectionAlignment de un RichTextbox, existe la
HorizontalAlignment.Center, HorizontalAlignment.Right y
HorizontalAlignment.Left.

Me preguntaba si había una forma de Alinear el texto en ambos márgenes,
es decir, Justificar el Texto...

Saludos!
Respuesta Responder a este mensaje
#3 elenaar
29/09/2003 - 22:28 | Informe spam
Has provado a usar SelectionIndent and SelectionRightIndent,
SelectionIndent the alinea el texto de la izquierda y SelectionRightIndent
el de la derecha, asi que si usas los dos te deberia justificar el texto
seleccionado.

Estos son los ejemplos que vienen en ayuda,

Private Sub WriteIndentedTextToRichTextBox()
' Clear all text from the RichTextBox;
RichTextBox1.Clear()
' Set the font for the text.
RichTextBox1.Font = New Font("Lucinda Console", 12)
' Specify a 20 pixel indent in all paragraphs.
RichTextBox1.SelectionIndent = 20
' Set the text within the control.
RichTextBox1.SelectedText = "All text is indented 20 pixels from the
left edge of the RichTextBox."
RichTextBox1.SelectedText = "You can use this property to provide proper
indentation such as when writing a letter."
RichTextBox1.SelectedText = "After this paragraph the indent is returned
to normal spacing." + ControlChars.Crlf
RichTextBox1.SelectionIndent = 0
RichTextBox1.SelectedText = "No indenation is applied to this paragraph.
All text in the paragraph flows from each control edge."
End Sub

Private Sub WriteIndentedTextToRichTextBox()
' Clear all text from the RichTextBox;
RichTextBox1.Clear()
' Set the font for the text.
RichTextBox1.Font = New Font("Lucinda Console", 12)
' Specify a 20 pixel right indent in all paragraphs.
RichTextBox1.SelectionRightIndent = 30
' Set the text within the control.
RichTextBox1.SelectedText = "All text is indented 20 pixels from the
right edge of the RichTextBox."
RichTextBox1.SelectedText = "You can use this property with the
SelectionIndent property to provide right and left margins."
RichTextBox1.SelectedText = "After this paragraph the indentation will
end." + ControlChars.CrLf
' Remove all right indentation.
RichTextBox1.SelectionRightIndent = 0
RichTextBox1.SelectedText = "This paragraph has no right indentation.
All text should flow as normal."
End Sub


Elena Arzac
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida