-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserControl1.cs
100 lines (93 loc) · 4.56 KB
/
UserControl1.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.IO;
using System.Runtime.Remoting;
using System.Runtime.Serialization.Formatters.Binary;
namespace SaveRestoreSplitterPosition {
/// <summary>
/// Summary description for UserControl1.
/// </summary>
public class UserControl1 : System.Windows.Forms.UserControl {
private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public UserControl1() {
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitializeComponent call
}
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
this.SizeChanged += UserControl1_SizeChanged;
}
private void UserControl1_SizeChanged(object sender, EventArgs e) {
this.SizeChanged -= UserControl1_SizeChanged;
splitContainerControl1.SplitterPosition = Settings.Default.SavedSplitterPosition;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing) {
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel2)).BeginInit();
this.splitContainerControl1.SuspendLayout();
this.SuspendLayout();
//
// splitContainerControl1
//
this.splitContainerControl1.DataBindings.Add(new System.Windows.Forms.Binding("SplitterPosition", global::SaveRestoreSplitterPosition.Settings.Default, "SavedSplitterPosition", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.splitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainerControl1.Location = new System.Drawing.Point(0, 0);
this.splitContainerControl1.Name = "splitContainerControl1";
//
// splitContainerControl1.Panel1
//
this.splitContainerControl1.Panel1.Appearance.BackColor = System.Drawing.Color.Lime;
this.splitContainerControl1.Panel1.Appearance.Options.UseBackColor = true;
this.splitContainerControl1.Panel1.Text = "splitContainerControl1_Panel1";
//
// splitContainerControl1.Panel2
//
this.splitContainerControl1.Panel2.Appearance.BackColor = System.Drawing.Color.Red;
this.splitContainerControl1.Panel2.Appearance.Options.UseBackColor = true;
this.splitContainerControl1.Panel2.Text = "splitContainerControl1_Panel2";
this.splitContainerControl1.Size = new System.Drawing.Size(256, 160);
this.splitContainerControl1.SplitterPosition = global::SaveRestoreSplitterPosition.Settings.Default.SavedSplitterPosition;
this.splitContainerControl1.TabIndex = 0;
this.splitContainerControl1.Text = "splitContainerControl1";
//
// UserControl1
//
this.Controls.Add(this.splitContainerControl1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(256, 160);
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
this.splitContainerControl1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
}
}