Solved

Control to use as an Editor with Correct New Line registering

Posted on 2004-04-14
11
237 Views
Last Modified: 2013-12-25
Hi Everyone,
I need to find/create a control that is reliable enough to use an editor on a VB form. So far i've tried textbox, mh3dtext, fpmemo and they are all buggy when it comes to registering new line characters. I need a control that when i put in some text, and click a button it breaks down each line in 35 char lots and a set no of lines. I can do the breaking down part, but only!! when the control returns me the new line character correctly i.e. cr/lf. Otherwise i've no means of knowing each line's text at a time in the textbox. Is there a control that I can access a line at a time, and resembles an editor?

Any help would be appreciated!!
0
Comment
Question by:tiseffies
  • 7
  • 3
11 Comments
 
LVL 3

Accepted Solution

by:
redfordb earned 20 total points
ID: 10831785
Have you tried the Rich Textbox that comes with VB ?
0
 

Author Comment

by:tiseffies
ID: 10837995
Hi Redfordb
Last time I checked, Rich Textbox doesn't recognise new lines at all.... Returning the Text value is the whole line without any delimiter!!
0
 

Author Comment

by:tiseffies
ID: 10838099
I've given it a shot using the Split function... though it still contains the new line recognition bug :(
Maybe i have to create my own??
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:tiseffies
ID: 10838352
Another problem i have with Richtextbox is that i can't have the vertical scrollbar fixed to always be there. It seems there are only 4 options, and the vertical option appears only when needed. I need to fix the chars across a line to 35 chars. I have no other way of doing this unless i fix the width of the control to 4000 and have the scrollbar fixed. Any other ideas?
Thanks
0
 

Author Comment

by:tiseffies
ID: 10839751
More Info:
I need a control that allows the right-click of copy and paste functionality.
P.s. hope i haven't confused everyone so far..
Cheers
0
 

Author Comment

by:tiseffies
ID: 10875266
Can anyone tell me whether there is a font that allows the same number of chars across a textbox (with wordrwap = true) all the time? whether normal or large windows fonts  are set? I thought Luicida Console was, but it isn't :(
0
 
LVL 8

Assisted Solution

by:rajaloysious
rajaloysious earned 480 total points
ID: 10898328
To always show the scrollbar
---------------
RichText1.ScrollBars = 2     '2 is for vertical
RichText1.DisableNoScroll = 1     ' 1 is for always showing the sdcrollbar
--------
I need a control that allows the right-click of copy and paste functionality
VB Text box can be used.
If you want this to be done in RichText,
RichTextBox1.AutoVerbMenu = True ' *****
-----------------
Can anyone tell me whether there is a font that allows the same number of chars across a textbox (with wordrwap = true) all the time?
-No --- depends upon the font size
0
 
LVL 8

Expert Comment

by:rajaloysious
ID: 10898338
I guess all your three questions are answered in my previous post.
0
 

Author Comment

by:tiseffies
ID: 10914708
One more question. There seems to be a glitch in the Rich Text box control
When i copy and paste text, say a word, and I realise i have to undo the paste, cause it exceeds the char maximum for the line, i set the keyascii value to 0 in the keypress event. Even though this undoes the word in other textbox controls, for richtextbox it doesnt. Any ideas?
0
 
LVL 8

Expert Comment

by:rajaloysious
ID: 10915565
Before you paste, check the number of chars copied in the clipboard.
If (it is less than or equal to the the number required,) then
RichTextBox1.AutoVerbMenu = True
else
RichTextBox1.AutoVerbMenu = False
endif
.
I guess I have answered all you previous questions.

You need to post new questions seperately. Thanks for your understanding. -)
Good luck
0
 

Author Comment

by:tiseffies
ID: 10924483
You'll find the problems I encountered fall under original problem, it's not a separate issue, though I perhaps left it vague. That's cause I was willing to accept alternative possible solutions you guys would offer, as I was still looking around for the nearest answer to my issue.
I appreciate your help and Thanks to all who attempted to help me out!!! :-)
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 36
Access query that references subform 5 47
Help me. 3 54
Publisher:   Unknown     VB.exe Application 1 21
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question