This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
/
Form1.cs
43 lines (33 loc) · 1.41 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Windows.Forms;
using System.Drawing.Design;
using DevExpress.XtraReports.UserDesigner;
// ...
namespace docEUDRenameToolboxItems {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void button1_Click(object sender, System.EventArgs e) {
// Create a new End-User Designer.
XRDesignFormEx designForm = new XRDesignFormEx();
// Handle the event when the report is loaded into the End-User Designer.
designForm.DesignPanel.DesignerHostLoaded += new DesignerLoadedEventHandler(OnDesignerLoaded);
// Load the report into the designer.
designForm.OpenReport(new XtraReport1());
// Show the End-User Designer window.
designForm.Show();
}
private void OnDesignerLoaded(object sender, DesignerLoadedEventArgs e) {
// Get the toolbox service.
IToolboxService ts = (IToolboxService)e.DesignerHost.GetService(typeof(IToolboxService));
// Get a collection of toolbox items.
ToolboxItemCollection coll = ts.GetToolboxItems();
// Iterate through toolbox items.
foreach (ToolboxItem item in coll) {
// Add the "Cool" prefix to all toolbox item names.
item.DisplayName = "Cool " + item.DisplayName;
}
}
}
}