Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > characters in a line in a richtextbox


Reply
 
Thread Tools Display Modes
  #1  
Old 05-23-2003, 07:26 PM
mohanakannan
Guest
 
Posts: n/a
Unhappy characters in a line in a richtextbox


hi,

how can i limit the number of characters in a line in a richtextbox.

example, i have a richtextbox in my form with width=12000
i want to limit the number of characters in each line to 60.
tat is, if i type "A" continously, then after 60 "A", cursor should come to
next line.... how can i do this ?
Reply With Quote
  #2  
Old 05-23-2003, 08:19 PM
navet1ss navet1ss is offline
Junior Contributor
 
Join Date: Mar 2003
Posts: 299
Default

You can set RichTextBox1.RightMargin (in twips) to tell it when to wordwrap. If you really want it to be consistent at 60 then you'll have to use a fixed width font.
__________________
NAVigation Electronics Technician 1st class Submarine Service
--------------------in case you were wondering--------------------
Reply With Quote
  #3  
Old 05-23-2003, 08:26 PM
mohanakannan
Guest
 
Posts: n/a
Default

can u explain it briefly..
how can i get the size in twips ???
and an example of fixed font...!!!
Reply With Quote
  #4  
Old 05-23-2003, 08:41 PM
navet1ss navet1ss is offline
Junior Contributor
 
Join Date: Mar 2003
Posts: 299
Default

The font that I frequently use that is fixed (all characters has the same height and width is "fixedSys". It's not a pretty font. I'm sure there are more but that's what works for me.

One way of calculating the width in twips is

Code:
Form1.ScaleMode = 1 'set to twips Form1.Font = "fixedsys" RichTextBox1.Font = "fixedsys" RichTextBox1.RightMargin = Form1.TextWidth(String(60, "X"))
__________________
NAVigation Electronics Technician 1st class Submarine Service
--------------------in case you were wondering--------------------
Reply With Quote
  #5  
Old 05-23-2003, 08:48 PM
mohanakannan
Guest
 
Posts: n/a
Default

hi..
Thx a lot...it workz fine..!!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing joined parallel line segments bart111 Game Programming 0 03-15-2003 06:32 PM
Only Show 80 characters per line Memnoch1207 Web Programming 3 01-23-2003 04:20 PM
Transfer private controls to another project.. Help! Jazler General 8 07-01-2002 09:59 AM
limit 70 characters per line elciocs General 1 06-24-2001 02:09 PM
How to goto end of the line or record line snownieve General 3 03-28-2001 01:14 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
 
 
-->