e.State.HotLight NEVER true for me...

  • Thread starter Thread starter Jack O'Lantern
  • Start date Start date
J

Jack O'Lantern

Hi everyone,


I'm using the ownerdraw functions for creating a menu, and while I can
get TRUE for e.State.Selected , I can't get a TRUE on
e.State.HotLight, no matter how much I run the mouse over the menu
item. I'm on Windows XP. Here's the code I'm using:

void MenuOnDraw(object sender, System.Windows.Forms.DrawItemEventArgs
e)
{

if ((e.State & DrawItemState.HotLight) == DrawItemState.HotLight)
{
e.Graphics.FillRectangle(new
SolidBrush(Color.CornflowerBlue),rc);

e.Graphics.DrawString( s1 , new Font("Veranda" , 10),new
SolidBrush(Color.Black), rc ,sf);


e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.Black)), rc );

e.Graphics.DrawString(num.ToString(), Font, Brushes.Black, 50, 0);
}
}

What do you guys think?
Note if I change "HotLight" to "Selected", it will function fine for
when I select the menu item.
 
Also, I've tried it this way:

if (

e.State ==
(DrawItemState.NoAccelerator | DrawItemState.Selected)

||

e.State ==
(DrawItemState.NoAccelerator | DrawItemState.HotLight)

)




Also, I have a console.writeline going out, and all I
ever get are NoAccellerator and Selected in e.State

What in the world is preventing me from giving this a
HotLight?
 
Guys,

After retarting the computer, I finally was able to get a
HotLight...wonder what the problem was...
 
Back
Top