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.
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.