public InertButton()
public InertButton(ImageList imageList, int imageIndexEnabled)
public InertButton(ImageList imageList, int imageIndexEnabled,
int imageIndexDisabled)
public InertButton(ImageList imageList, int imageIndexEnabled,
int imageIndexDisabled, ImageAttributes imageAttr)
using Crownwood.Magic.Controls;
// Create color-remapping objects
ColorMap remap1 = new ColorMap();
ColorMap remap2 = new ColorMap();
// Change any black pixels to blue
remap1.OldColor = Color.Black;
remap1.NewColor = Color.Blue;
// Change any white pixels to red
remap2.OldColor = Color.White;
remap2.NewColor = Color.Red;
// Create the image attributes object
ImageAttributes myAttribs = new ImageAttributes();
// Define the image remappings
myAttribs.SetRemapTable(new ColorMap[]{remap1, remap2});
// Use the overloaded constructor that takes two
// different images for enabled/disabled and also
// applies the image attributes to drawing them both
InertButton myButton = new InsertButton(imageList, 0, 1, myAttribs);
// Define the size and position
myButton.Size = new Size(32,32);
myButton.Location = new Point(10,10);
// We want notification when button is pressed
myButton.Click += new EventHandler(OnButtonClick);
MenuItemEx Filemenu = new MenuItemEx("File", new EventHandler(menuClick));
MenuItemEx Editmenu = new MenuItemEx("Edit", new EventHandler(menuClick));
MenuItem[] menu = new MenuItem[] {Filemenu,Editmenu};
Filemenu.MenuItems.Add(new MenuItemEx("Open",new EventHandler(menuClick)));
this.Menu = new MainMenu(menu);
//MenuItemEx 是我人CodeProject上下载的XPMenu例子里的,你也是下载这个吧,这么用就行了