Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Mike Williams" Newsgroups: comp.lang.basic.visual.misc Subject: Re: Adding the Picture Property to a RichTextBox control (VB6) Date: Sat, 23 Apr 2011 21:41:07 +0100 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <9a9dd650-5759-423b-a207-d371a9dd7bba@w9g2000prg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Injection-Date: Sat, 23 Apr 2011 20:40:44 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="HYt+pNm+kqa/jQDJvanm2w"; logging-data="9828"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18rRUu4ZWh9out9Ic2eMBgeIH70FEc/6Jw=" X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18417 In-Reply-To: <9a9dd650-5759-423b-a207-d371a9dd7bba@w9g2000prg.googlegroups.com> X-Newsreader: Microsoft Windows Mail 6.0.6002.18197 Cancel-Lock: sha1:SUUW/bnsf3uUuza09W1QISdcHMM= X-Priority: 3 X-MSMail-Priority: Normal Xref: x330-a1.tempe.blueboxinc.net comp.lang.basic.visual.misc:91 "Jason Bodine" 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