Hi,

I am trying to implement a context menu that is 50% transparent. Setting
the opacity to 0.5 works but unfortunately the texts are also displayed
with transparency which makes them very hard to read.

Now I would like to draw the menu background with transparency but the text
without.

I have tried various approaches without success:

- Implement a ToolstripRenderer: Draws a gray background despite overriding
all overridable methods
- Handle Paint event of each menu item: Text gets drawn with transparency

Does anybody have an idea how to approach this?

Thanks in advance,

Hans

Re: Transparent ContextMenuStrip with non-transparent text by Bryan

Bryan
Tue Jan 16 19:29:09 CST 2007

Take a look at this example:
http://www.danielmoth.com/Blog/2006/06/vista-glass-in-c_17.html


--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com



"hans_merkl@rhmmedia.com" <hans_merkl@rhmmedia.com> wrote in message
news:5v9zmgwhz9fx.1nbl8kl1cx43e.dlg@40tude.net:

> Hi,
>
> I am trying to implement a context menu that is 50% transparent. Setting
> the opacity to 0.5 works but unfortunately the texts are also displayed
> with transparency which makes them very hard to read.
>
> Now I would like to draw the menu background with transparency but the text
> without.
>
> I have tried various approaches without success:
>
> - Implement a ToolstripRenderer: Draws a gray background despite overriding
> all overridable methods
> - Handle Paint event of each menu item: Text gets drawn with transparency
>
> Does anybody have an idea how to approach this?
>
> Thanks in advance,
>
> Hans


Re: Transparent ContextMenuStrip with non-transparent text by Hans

Hans
Tue Jan 16 21:17:05 CST 2007

On Wed, 17 Jan 2007 01:29:09 +0000, Bryan Phillips wrote:

> Take a look at this example:
> http://www.danielmoth.com/Blog/2006/06/vista-glass-in-c_17.html

Bryan,

It seems that code works only with Vista. Do youn think I can use parts of
it with Win 2000 or XP?

Hans