Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Im using a Rich Text Box for document creation but I need to set the Margin Rules (Column Position) so pressing TAB lines up according to where I specify

 

Whats the property any one know?

 

Cheers

 

Andy

Code today gone tomorrow!
  • Leaders
Posted (edited)

you mean the selindent then? as in how far from the left of the richtextbox the text starts? if so this is an example i put together to show how the indent moves the text over...

   Private Sub Button1_Click(ByVal sender As System.Object, _
     ByVal e As System.EventArgs) _
     Handles Button1.Click 
       RichTextBox1.SelectionStart = Len(RichTextBox1.Text)
       RichTextBox1.SelectionIndent = 0
       RichTextBox1.SelectedText = "TEXT ON LEFT" & vbCrLf

       'first set some text from the very edge of the rtf box

       RichTextBox1.SelectionStart = Len(RichTextBox1.Text)
       RichTextBox1.SelectionIndent = 10
       RichTextBox1.SelectedText = "TEXT MOVED OUTWARDS" & vbCrLf

       'then set some with the indent set to "10"
End Sub

 

when you click the command button, you'll first get the text at the very left of the box, then on the next row you'll get the text with a margin to the left of it.

hope this helps you :)

Edited by dynamic_sysop

  • Leaders
Posted

no problem:) , btw as you probably know the numbers for size ( ie: the 10 in the indent area ) are way different to vb6. in vb6 i use 200 as a rough indent for seltext, i tried 200 in .net and there was text in the last 5 millimeters of the richtextbox, but most of the box was blank due to the size of the indent.

i'm not to sure what the differences are with the sizes and if it's possible to calculate what a vb6 size is in .net but size of indent being 10 in .net, is pretty similar to size 200 in vb6.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...