Windows Forms Topics include: windows forms, controls, components and designers

Go Back  Xtreme .NET Talk > .NET > Windows Forms > Rich Text Box Margin


Reply
 
Thread Tools Display Modes
  #1  
Old 03-19-2003, 07:08 AM
a_jam_sandwich's Avatar
a_jam_sandwich a_jam_sandwich is offline
Junior Contributor

Preferred language:
VB.NET
 
Join Date: Dec 2002
Location: Uk
Posts: 367
a_jam_sandwich is on a distinguished road
Default Rich Text Box Margin



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!
Reply With Quote
  #2  
Old 03-19-2003, 08:15 AM
dynamic_sysop's Avatar
dynamic_sysop dynamic_sysop is offline
Senior Contributor

Preferred language:
C#
 
Join Date: Oct 2002
Location: Ashby, Leicestershire.
Posts: 1,039
dynamic_sysop is on a distinguished road
Default

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...
Code:
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

Last edited by dynamic_sysop; 03-19-2003 at 08:23 AM.
Reply With Quote
  #3  
Old 03-19-2003, 08:21 AM
a_jam_sandwich's Avatar
a_jam_sandwich a_jam_sandwich is offline
Junior Contributor

Preferred language:
VB.NET
 
Join Date: Dec 2002
Location: Uk
Posts: 367
a_jam_sandwich is on a distinguished road
Default

Cheers Will look
__________________
Code today gone tomorrow!
Reply With Quote
  #4  
Old 03-19-2003, 08:33 AM
dynamic_sysop's Avatar
dynamic_sysop dynamic_sysop is offline
Senior Contributor

Preferred language:
C#
 
Join Date: Oct 2002
Location: Ashby, Leicestershire.
Posts: 1,039
dynamic_sysop is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 03-20-2003, 06:33 AM
divil's Avatar
divil divil is offline
Banned
 
Join Date: Nov 2002
Location: England
Posts: 2,746
divil is on a distinguished road
Default

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).
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rich Text Box PhilBayley ASP.NET 1 09-05-2005 09:54 PM
New Line in a rich text box Lanc1988 General 2 03-27-2005 11:15 PM
rich text box formatting atesh Windows Forms 1 09-04-2003 04:27 PM
rich text box to file hazejean Directory / File IO / Registry 3 08-08-2003 06:36 PM
Rich Text Box msappletech Windows Forms 5 06-05-2003 03:41 PM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe