PC Review


Reply
Thread Tools Rate Thread

Creating DrawItemEventArgs for MenuItem

 
 
Tom
Guest
Posts: n/a
 
      12th May 2004
Hi

I am trying to force a drawitem for an owner drawn menuitem. As the
menuitem has no invalidate method i thought that i could just call the
overriden drawitem method, this need a DrawItemEventArgs parameter,
which i cannot create for the MenuItem. Anyone know how to force it?

I can create it using the CreateGraphics property of the parent
control, however this redraws the menuitem on the parent control
rather than the menu item... not so good:



Thanks

Tom
 
Reply With Quote
 
 
 
 
Bharat Patel [MSFT]
Guest
Posts: n/a
 
      12th May 2004
Hi Tom,

Look at the work-around section of the following article for the code snippet
in C# to create a new DrawItemEventArgs object.

834530 BUG: The DrawItemEventArgs object returns incorrect ForeColor and
http://support.microsoft.com/?id=834530

You can follow the same logic in VB .net.

Hope this helps!
Bharat Patel
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set a MenuItem's ID Saul775 Microsoft C# .NET 2 30th Jan 2008 06:50 PM
Adding to an existing MenuItem's MenuItem Collection Dynamically snesbit Microsoft Dot NET Framework Forms 3 9th Mar 2005 03:08 AM
Adding to an existing MenuItem's MenuItem Collection Dynamically snesbit Microsoft VB .NET 1 9th Mar 2005 03:05 AM
How to set DrawFocusRectangle() correctly using custom DrawItemEventArgs? Peder Y Microsoft C# .NET 1 13th Sep 2004 04:41 PM
How to set DrawFocusRectangle() correctly using custom DrawItemEventArgs? Peder Y Microsoft C# .NET 0 5th Sep 2004 06:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 PM.