本帖最后由 Richard.Ma 于 2021-6-16 10:31 编辑
问题已经收到,这个可以通过获取到页面上的C1Toolbar来调整,代码如下
- foreach(var c in flexPivotPage1.Controls)
- {
- if(c is C1ToolBar)
- {
- C1ToolBar toolbar = c as C1ToolBar;
- foreach(C1CommandLink link in toolbar.CommandLinks)
- {
- if (link.Text == "导入")
- {
- C1Command importcommand = new C1Command() { Image= link.Command.Image.Clone() as Image};
- importcommand.Click += new ClickEventHandler((s, e) => {
- MessageBox.Show("开始导入");
- });
- link.Command = importcommand;
-
- }
- else if (link.Text == "保存")
- {
- C1Command savecommand = new C1Command() { Image = link.Command.Image.Clone() as Image };
- savecommand.Click += new ClickEventHandler((s, e) => {
- MessageBox.Show("开始保存");
- });
- link.Command = savecommand;
- }
- }
- }
- }
复制代码
|