回复 1楼mimima2020的帖子
mimima2020 你好
不知道你使用的是ActiveReports哪个版本,在ActiveReports 9中提供了Designer.LayoutChanging 事件,你可以在这个事件中判断用户的操作类型:
- private void ardMain_LayoutChanging(object sender, GrapeCity.ActiveReports.Design.LayoutChangingArgs e)
- {
- if (e.Type == Design.LayoutChangeType.SectionDelete)
- {
- DialogResult Result;
- Result = MessageBox.Show("Are you sure you want to delete this section?", "Delete?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
- if (Result == DialogResult.Cancel)
- {
- e.AllowChange = false;
- }
- else
- {
- e.AllowChange = true;
- }
- }
- }
复制代码 |