a_jam_sandwich Posted March 19, 2003 Posted March 19, 2003 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 Quote Code today gone tomorrow!
Leaders dynamic_sysop Posted March 19, 2003 Leaders Posted March 19, 2003 (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 March 19, 2003 by dynamic_sysop Quote
a_jam_sandwich Posted March 19, 2003 Author Posted March 19, 2003 Cheers Will look Quote Code today gone tomorrow!
Leaders dynamic_sysop Posted March 19, 2003 Leaders Posted March 19, 2003 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. Quote
*Gurus* divil Posted March 20, 2003 *Gurus* Posted March 20, 2003 I would guess that in VB6 that measurement was in Twips. Thankfully, Twips have gone the way of the dodo in .net (although if you look hard enough you can find references in the vb.net runtime). Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.