-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
60 lines (56 loc) · 2.13 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Developer Express Code Central Example:
// How To: Create WidgetView at runtime
//
// This example demonstrates how to create and customize WidgetView with 2
// StackGroups at runtime.
//
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E5003
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.Widget;
using DevExpress.XtraEditors;
namespace WidgetViewExample {
public partial class Form1 : XtraForm {
public Form1() {
InitializeComponent();
}
void Form1_Load(object sender, EventArgs e) {
AddDocumentManager();
for (int i = 0; i < 3; i++) {
AddDocuments();
}
//Adding Documents to group1 is not necessary, since all newly created Documents are automatically placed in the first StackGroup.
group1.Items.AddRange(new Document[] { view.Documents[0] as Document, view.Documents[1] as Document });
view.Controller.Dock(view.Documents[2] as Document, group2);
}
WidgetView view;
StackGroup group1, group2;
void AddDocumentManager() {
DocumentManager dM = new DocumentManager(components);
view = new WidgetView();
dM.View = view;
view.AllowDocumentStateChangeAnimation = DevExpress.Utils.DefaultBoolean.True;
group1 = new StackGroup();
group2 = new StackGroup();
group1.Length.UnitType = LengthUnitType.Star;
group1.Length.UnitValue = 2;
view.StackGroups.AddRange(new StackGroup[] { group1, group2 });
dM.ContainerControl = this;
}
int count = 1;
void AddDocuments() {
Document document = view.AddDocument(new ucPreview()) as Document;
document.MaximizedControl = new ucMaximizedContent();
count++;
}
}
}