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


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

Re: Adding the Picture Property to a RichTextBox control (VB6)

From "Mike Williams" <Mike@WhiskyAndCoke.com>
Newsgroups comp.lang.basic.visual.misc
Subject Re: Adding the Picture Property to a RichTextBox control (VB6)
Date 2011-04-23 21:41 +0100
Organization A noiseless patient Spider
Message-ID <iovdgc$9j4$1@dont-email.me> (permalink)
References <be977bb4-7fa1-4ae8-9751-c1d649078ef5@2g2000vbl.googlegroups.com> <ef6bf455-0be3-47bb-8eb5-5dda86621124@l2g2000prg.googlegroups.com> <iould2$me$1@dont-email.me> <9a9dd650-5759-423b-a207-d371a9dd7bba@w9g2000prg.googlegroups.com>

Show all headers | View raw


"Jason Bodine" <jbodine1974@gmail.com> wrote in message 
news:9a9dd650-5759-423b-a207-d371a9dd7bba@w9g2000prg.googlegroups.com...

> What about subclassing the RTB to handle background images?
> Is there a way to do that?  I found an example that lets you put
> a background in a regular TextBox control, but when I tried it
> with the RTB, I got an error in Runtime saying it was looking
> for a control with a different CLSID (I can't remember it off the
> top of my head, lol). Any ideas?

Well normally in such cases I would say that subclassing is likely to 
provide a good solution, but whereas I have been able to subclass a standard 
TextBox so as to provide background images I have not so far been able to do 
the same for the RichTextBox. With an RTB similar subclassing code runs fine 
and the various functions appear to succeed, but the RTB does not respond as 
expected. I would have continued to try to work out a solution for that but 
I lost interest long ago when I managed to produce the desired result with 
much less code simply by using a standard VB Image Control behind the RTB 
with the Image Control's Picture property set to an image of the desired 
background and with WS_EX_TRANSPARENT used on the RTB. That method works 
fine on XP and Vista and Win7. The only slight drawback is that when run on 
Vista or Win7 with Desktop Composition disabled it very occasionally leaves 
behind a single ghost image of the previous flashing insertion point, but it 
works fine with no problems at all on those systems when run at the standard 
Desktop Composition. Did you not see my previous response to your question?

Mike

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


Thread

Adding the Picture Property to a RichTextBox control (VB6) Jason Bodine <jbodine1974@gmail.com> - 2011-04-19 02:02 -0700
  Re: Adding the Picture Property to a RichTextBox control (VB6) Jason Bodine <jbodine1974@gmail.com> - 2011-04-23 05:04 -0700
    Re: Adding the Picture Property to a RichTextBox control (VB6) "Mayayana" <mayayana@invalid.nospam> - 2011-04-23 09:51 -0400
      Re: Adding the Picture Property to a RichTextBox control (VB6) Jason Bodine <jbodine1974@gmail.com> - 2011-04-23 11:52 -0700
        Re: Adding the Picture Property to a RichTextBox control (VB6) "Mayayana" <mayayana@invalid.nospam> - 2011-04-23 15:56 -0400
        Re: Adding the Picture Property to a RichTextBox control (VB6) "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-04-23 21:41 +0100
    Re: Adding the Picture Property to a RichTextBox control (VB6) "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-04-23 16:43 +0100

csiph-web