我有一个为 C1Editor 创建工具条按钮的类,它工作正常,因为命令是内置的。大约有五种表单使用这个类来创建他们的工具条按钮。我正在添加一个自定义按钮,这需要一个点击事件,这就是我迷路的地方。我需要你们的帮助。类代码如下:
public class AlrFrontEndToolStrip : C1EditorToolStripBase
{
protected override void OnInitialize()
{
base.OnInitialize();
AddButton(CommandButton.Copy);
AddButton(CommandButton.Paste);
Items.Add(new ToolStripSeparator());
AddButton(CommandButton.SelectAll);
AddButton(CommandButton.Find);
Items.Add(new ToolStripSeparator());
AddButton(CommandButton.Print);
Items.Add(new ToolStripSeparator());
Items.Add(new ToolStripButton().Text = "View Judgment", Properties.Resources.Find_VS, onClick: EventHandler.CreateDelegate( "Push");
}
}
如果我删除以下位:'onClick: EventHandler.CreateDelegate("Push")',它会完美运行。那么我怎样才能使按钮以各种形式可点击,并且每个都实现自己的点击。