VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to highlight owner-drawn menu items in XP, as ItemState = ODS_SELECTED is not available.

by Eric T (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 23rd October 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to highlight owner-drawn menu items in XP, as ItemState = ODS_SELECTED is not available.

Rate How to highlight owner-drawn menu items in XP, as ItemState = ODS_SELECTED is not available.




However, when the mouse moves over a menu item, the state changes to &H101 (257). Therefore you can check for item selection and highlight the entry accordingly or draw normally using:

if strOSName = "XP" then
     if DrwaInfo.ItemState = 257 then
          blnSelected = True
     Else
          blnSelected = False
     End if
Else
     blnSelected = True
End if

...

If DrawInfo.ItemState = ODS_SELECTED _
     OR blnSelected then
     HighlightTheMenuItem
Else
     DrawMenuItemNormally
end if

Cheers, Eric T

Download this snippet    Add to My Saved Code

How to highlight owner-drawn menu items in XP, as ItemState = ODS_SELECTED is not available. Comments

No comments have been posted about How to highlight owner-drawn menu items in XP, as ItemState = ODS_SELECTED is not available.. Why not be the first to post a comment about How to highlight owner-drawn menu items in XP, as ItemState = ODS_SELECTED is not available..

Post your comment

Subject:
Message:
0/1000 characters