在菜单中加入图标

1.:

[System.Runtime.InteropServices.DllImport("user32")]
private static extern int SetMenuItemBitmaps(IntPtr hMenu, int nPosition, int wFlags, IntPtr hBitmapUnchecked,IntPtr hBitmapChecked);
const int MF_BYPOSITION = 0x0400;

2.:

private void Form1_Load(object sender, System.EventArgs e)
{
    IntPtr mHandle=this.menuItem1.Handle;
    Bitmap bp;

    bp=new Bitmap("..\\..\\FIND.BMP");
    SetMenuItemBitmaps(mHandle,0,MF_BYPOSITION,bp.GetHbitmap(),bp.GetHbitmap());

    bp=new Bitmap("..\\..\\CAMERA.BMP");
    SetMenuItemBitmaps(mHandle,1,MF_BYPOSITION,bp.GetHbitmap(),bp.GetHbitmap());
}
Contributors: FHL