Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #483

Re: RichEdit control question

From "Mike Williams" <Mike@WhiskyAndCoke.com>
Newsgroups comp.lang.basic.visual.misc
Subject Re: RichEdit control question
Date 2011-10-13 11:41 +0100
Organization A noiseless patient Spider
Message-ID <j76f8o$pp9$1@dont-email.me> (permalink)
References (2 earlier) <j72blo$pug$1@dont-email.me> <j72cbr$uln$1@dont-email.me> <j72e4n$b77$1@dont-email.me> <j73duf$gns$1@dont-email.me> <j7573i$fnl$1@dont-email.me>

Show all headers | View raw


"Kalkidas" <eat@joes.pub> wrote in message 
news:j7573i$fnl$1@dont-email.me...

> I can easily translate VB6 into VB.NET, so information
> about using VB6 with the richedit control is just as much
> a help.

Well I don't really use the richedit control myself, other than using the 
VB6 RichTextBox wrapper, and so I have no idea whether it has methods or 
messages or whatever to show and hide text globally, but if it does not have 
any such methods then have you ever considered writing some code to perform 
that task yourself? Or is writing code no longer possible in VB.Net? Have 
they moved so far into managed code that they manage to automatically write 
it for you as well?

Just to pretend for a moment that I am not one of the group of people 
mentioned by Deanna Earley [ ;-) ] the starting point would be the 
realisation that even if there is richedit control method to hide text 
globally within the control it will almost certainly not actually be doing 
it with a single switch, even if it is a single method, and it will 
definitely be doing it by inserting the appropriate switches into all the 
appropriate places in the rtf. So, if you cannot find its native method or 
if it does not have one then here's a rough idea of how I would personally 
start to develop such a function in VB6 using a VB6 RichTextBox, if that's 
any help to you:

Private Const beginHide As String = "\v "
Private Const endHide As String = "\v0 "

Private Sub Command1_Click()
Dim s1 As String, sHide As String
RichTextBox1.Text = "I like Rum and Coke and I drink Rum and Coke every 
day."
sHide = "Rum and "
s1 = Replace(RichTextBox1.TextRTF, sHide, beginHide & sHide & endHide)
RichTextBox1.TextRTF = s1
End Sub

The above code will hide the "Rum and " phrases within the document and if 
you save it out as a rtf file and load it into something else, MS Word for 
example, then the text will remain hidden when viewed in the MS Word 
document, and if you then use the appropriate MS Word method to "Unhide" any 
hidden text then it will appear again. Is that something like you want to 
do? If so then it should not be too difficult to convert it to using a Byte 
array, which should use less temporary memory and be more flexible, and to 
add the appropriate UnHide method.

Mike


Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-10 14:41 -0700
  Re: RichEdit control question "Nobody" <nobody@nobody.com> - 2011-10-11 00:53 -0400
  Re: RichEdit control question BTIS Jeff <btisjb@gmail.com> - 2011-10-11 08:17 -0700
    Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-11 14:17 -0700
      Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-11 22:27 +0100
        Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-11 14:59 -0700
          Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-12 08:00 +0100
            Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-12 16:18 -0700
              Re: RichEdit control question Deanna Earley <dee.earley@icode.co.uk> - 2011-10-13 08:45 +0100
              Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 10:24 +0100
              Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 11:41 +0100
              Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 13:30 +0100
  Re: RichEdit control question Eric Coleman <eric@strategon.com> - 2011-10-13 19:55 -0500
    Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-14 09:30 +0100
    Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-15 07:53 -0700
      Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-15 17:03 +0100
      Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 12:25 -0500
        Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 12:29 -0500
        Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-15 12:45 -0700
          Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 15:24 -0500
          Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-15 23:16 +0000
            Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-16 18:21 -0700
              Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 23:15 -0400
              Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 17:19 -0400
                Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-17 15:59 -0700
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 19:59 -0400
                Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-17 17:34 -0700
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 23:46 -0400
                Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-18 07:35 -0700
                Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-18 15:17 +0000
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-19 10:09 -0400
                Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-19 18:26 +0100
          Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-15 19:53 -0400
            Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-16 03:32 +0000
              Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 12:02 -0400
                Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-16 22:10 +0000
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 19:17 -0400
                Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-17 09:43 +0000

csiph-web