Input with tabs from RichTextBox to string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #1

    Input with tabs from RichTextBox to string

    Hi I'm trying to get my input from a RichTextBox into a string, but the tabs in my input are left away. Is this a limitation of string, or am I doing something wrong? I'm trying to do this like this:
    [CODE=VB]string = RichTextBox.tex t[/CODE]

    Yarr Of Doom
  • VBPhilly
    New Member
    • Aug 2007
    • 95

    #2
    Originally posted by yarrofdoom
    Hi I'm trying to get my input from a RichTextBox into a string, but the tabs in my input are left away. Is this a limitation of string, or am I doing something wrong? I'm trying to do this like this:
    [CODE=VB]string = RichTextBox.tex t[/CODE]

    Yarr Of Doom
    Sounds like you want the tabs to remain in the string?

    Is there an RTF property in VB6? I know there is one in VB.net.
    This is what you should use when checking for tabs. I think the tab will be represented as a "/t" in the RTF value. Then you can simply find the location and insert it into the string returned from .text.

    Give it a shot.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      I've just double-checked, and the .Text property does return tabs as expected. Why do you think there's a problem?

      Of course, you're welcome to go digging through this garbage if you want to track down the "\tab" as suggested by VBPhilly...
      Code:
      {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
      \viewkind4\uc1\pard\lang3081\f0\fs17 dfg dsfigjkgjkg[B]\tab[/B] jkfgjf[B]\tab[/B] 
      \par }

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        You have to use :

        RichTextBox1.Te xtRTF

        to get the RTF source..

        Regards
        Veena

        Comment

        • YarrOfDoom
          Recognized Expert Top Contributor
          • Aug 2007
          • 1243

          #5
          Originally posted by Killer42
          I've just double-checked, and the .Text property does return tabs as expected. Why do you think there's a problem?
          You were right indeed, I had a bug in my code which caused my output to be wrong, and in debugging mode, tabs aren't always displayed right.

          Yarr of Doom

          Comment

          Working...