B
Benny Raymond
I've written a class that inherits from MenuItem which displays icons
next to the items in a menu... The only problem I'm having is that I
have no clue how to turn these icons greyscale if they're item is
disabled. Right now I'm turning the text grey and would like to also
grey out the icon. Any help would be awesome. here's my code for
drawing the icon:
if ( this._icon != null )
{
if ( this.Text != "" && this.Text != "X" )
e.Graphics.DrawIcon(this._icon, e.Bounds.Left+ICON_PAD_LEFT,
e.Bounds.Top+ICON_PAD_TOP);
else
e.Graphics.DrawIcon(this._icon, e.Bounds.Left + ((e.Bounds.Width -
this._icon.Width) / 2), e.Bounds.Top+ICON_PAD_TOP); // center the icon
}
next to the items in a menu... The only problem I'm having is that I
have no clue how to turn these icons greyscale if they're item is
disabled. Right now I'm turning the text grey and would like to also
grey out the icon. Any help would be awesome. here's my code for
drawing the icon:
if ( this._icon != null )
{
if ( this.Text != "" && this.Text != "X" )
e.Graphics.DrawIcon(this._icon, e.Bounds.Left+ICON_PAD_LEFT,
e.Bounds.Top+ICON_PAD_TOP);
else
e.Graphics.DrawIcon(this._icon, e.Bounds.Left + ((e.Bounds.Width -
this._icon.Width) / 2), e.Bounds.Top+ICON_PAD_TOP); // center the icon
}