Re: Rich Text box masks Line Feed



You scare me!
I have a complex VB6 Script editing application that started life as a text box before I reimplemented it with a rich text box: the thoery was, and according to my .net text books (sorry about the pun) that a RTB control should substitute for a text control WITHOUT ANY CHANGES: what you state suggests that this isn't true. it also means that I need to review the effort of migrating this app to VB200x as it has HUNDREDS of references to CR throughout the application: I was anticipating hours of pain and suffering as it is (hence it is still VB6) fixing the hundreds of dim as objects that are going to spring up when I convert without actually having to review functionality too. Lots of Mid statements with explicit lengths looking for keywords and scans of partial lines attempting to parse vbscript for syntax errors. The problem is, bits of VB6 keep breaking on Vista (for example Help is broken now!) AAARRRGGGGHHHH! My head hurts!
A
"Justin Roberts" <JustinRoberts@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:19300E05-F128-40D5-83A0-01C7C4E9476C@xxxxxxxxxxxxxxxx
Yes, I did mean the standard Forms.RichTextBox
Apologies for not being clear on that one.

Also, you're right about the linefeed. I actually meant the Carriage Return
(vbCR) character. Sorry for the bad post.
InStr(rtb.Text, vbCR) always = 0

I need all the CR characters to be included as part of in my Text,
SelectionStart, SelectionLength, SelectedText, etc. properties.

Regards
Justin.

When you say "RTB control", I assume you mean something like
rtb As System.Windows.Forms.RichTextBox
I don't get the behavior you describe. rtb.SelectedText contains line feeds
for me, and they are included in the length. If rtb contains linefeeds, then
InStr(rtb.Text, vbLf) > 0.
What's the problem?


.



Relevant Pages

  • Re: Is there ANY installer than can totally roll back an installation?
    ... But, Bob, does that procedure also include VB6 apps? ... systems with System File Protection. ... installer won't try to overwrite the existing version but ... but the VB RTB wraps the RichEdit v. 1 DLL. ...
    (microsoft.public.vb.general.discussion)
  • Re: Is there ANY installer than can totally roll back an installation?
    ... But, Bob, does that procedure also include VB6 apps? ... systems with System File Protection. ... installer won't try to overwrite the existing version but ... but the VB RTB wraps the RichEdit v. 1 DLL. ...
    (microsoft.public.vb.general.discussion)
  • printing a Rich text box?
    ... In VB6 this is easy, One method of the RTB does it. ... I use this to teach first year students how to make a simple word processor ...
    (microsoft.public.dotnet.languages.vb)