Painting a Controls's Parent onto the Control himself 
Author Message
 Painting a Controls's Parent onto the Control himself

Hi,
I'm trying to create a 'semitransparent' Control, that integrates seamlessly
with it's container. To do this, I need the Container's Background painted
onto my Control. Specifically I am trying to use these Controls on
TabPages...

With GDI I'd use WM_PRINTCLIENT and pass my hdc to achieve this. I've tried
this with a dotnet TabPage so far, and it's NOT working..
I also tried Parent.InvokePaintBackground(...),passing a custom
DrawingObject, but this causes 'protected Method' error (won't compile).
Declaring the Parent as Control and catching the Paint Event didn't help as
well (EventHandler was simply not called)

So, anybody got an idea on how to do this? Did I just miss some function?
Any help on this is apreciated...



Fri, 17 Jun 2005 10:25:09 GMT  
 Painting a Controls's Parent onto the Control himself
Hi Alexander,

Have you tried SupportsTransparentBackColor style. If this bit is set, and
the BackColor is set to a color whose alpha component is less than 255,
OnPaintBackground will simulate transparency by asking its parent control
to paint the background.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:

>Newsgroups:

microsoft.public.dotnet.framework.drawing,microsoft.public.dotnet.framework.
windowsforms,microsoft.public.dotnet.framework.windowsforms.controls,microso
ft.public.dotnet.general,microsoft.public.dotnet.languages.vb
Quote:
>Subject: Painting a Controls's Parent onto the Control himself
>Date: Mon, 30 Dec 2002 03:25:09 +0100
>Organization: T-Online
>Lines: 17

>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: news.t-online.com 1041214745 06 2589 1rmpEdoSLAYIR 021230 02:19:05


>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Path:

cpmsftngxa06!TK2MSFTNGP08!cppssbbsa01.microsoft.com!news-out.cwix.com!newsfe
ed.cwix.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.f
jserv.net!proxad.net!teaser.fr!fr.clara.net!heighliner.fr.clara.net!newsfeed
01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!n
ot-for-mail
Quote:
>Xref: cpmsftngxa06 microsoft.public.dotnet.framework.windowsforms:35969

microsoft.public.dotnet.framework.windowsforms.controls:4709
microsoft.public.dotnet.general:78446
microsoft.public.dotnet.languages.vb:82187
microsoft.public.dotnet.framework.drawing:4728

- Show quoted text -

Quote:
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>Hi,
>I'm trying to create a 'semitransparent' Control, that integrates
seamlessly
>with it's container. To do this, I need the Container's Background painted
>onto my Control. Specifically I am trying to use these Controls on
>TabPages...

>With GDI I'd use WM_PRINTCLIENT and pass my hdc to achieve this. I've tried
>this with a dotnet TabPage so far, and it's NOT working..
>I also tried Parent.InvokePaintBackground(...),passing a custom
>DrawingObject, but this causes 'protected Method' error (won't compile).
>Declaring the Parent as Control and catching the Paint Event didn't help as
>well (EventHandler was simply not called)

>So, anybody got an idea on how to do this? Did I just miss some function?
>Any help on this is apreciated...



Mon, 20 Jun 2005 10:55:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Control painting on parent form

2. referencing a control's 'parent'

3. Paint Event isn't ever called by the Rich Text Box control

4. Preventing a control's paint event

5. tab control - loading controls onto tabs in runtime

6. Paint the background of a control on the control

7. Resize of a user control's parent

8. Getting Parent's Name from a user control

9. Control's parent form active?

10. Parent.Controls.Add when parent is a usercontrol

11. (Programming)How to get parent control or move next control of radiobutton

12. Adding controls to a parent control?

 

 
Powered by phpBB® Forum Software