Put a Red Border around a Menu Item Icon

I want to draw a red border around a 24x24 pixel menu Item Icon when it’s Sub menu Item is Checked (mnuSubItem1.Checked = True). This is my code below that is not working. What am do I have to Change to make it work or can it even be done?

[code]mnuItem.Icon = IconPict '24x24pixel

mnuSubItem1.Checked = Not mnuSubItem1.Checked

If mnuSubItem1.Checked = True Then
mnuItem1.Icon.Graphics.ForeColor=&cff0000
mnuItem1.Icon.Graphics.PenHeight=5
mnuItem1.Icon.Graphics.DrawRect(0, 0, mnuItem1.Icon.Graphics.Width, mnuItem1.Icon.Graphics.Height)
Elseif mnuSubItem1.Checked = False Then
mnuItem1.Icon.Graphics.ClearRect(0, 0, mnuItem1.Icon.Graphics.Width, mnuItem1.Icon.Graphics.Height)
End If[/code]

Thanks

I found using fatcows icons which have a transparent background that probably because they use a mask, I could not draw in the transparent areas.

The workaround is to not use the icon directly, but to create a new picture with Alpha channel, and drawinto the icon, so it becomes possible to drawrect into the new picture.

myIcon is a window picture property

If TargetWin32 then App.UseGDIPlus = True // Necessary to dim the picture with alpha channel myIcon = new picture(16,16) myIcon.graphics.drawpicture(apple,0,0) myIcon.graphics.drawrect(0,0,16,16) EditFind.icon = myIcon