This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Styling.cs
57 lines (48 loc) · 2.09 KB
/
Styling.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
using System.Reflection;
using System.Windows.Forms;
using System.Drawing;
namespace DWSIM.UI.Desktop.WinForms
{
public static class StyleSetter
{
public static void SetStyles()
{
Eto.Style.Add<Eto.Forms.TextArea>("labeldescription", label =>
{
var wflabel = (RichTextBox)label.ControlObject;
wflabel.BackColor = SystemColors.Control;
wflabel.ScrollBars = RichTextBoxScrollBars.None;
wflabel.BorderStyle = BorderStyle.None;
var wftl = (TableLayoutPanel)((Eto.WinForms.Forms.Controls.TextAreaHandler)label.Handler).ContainerControl;
wftl.BackColor = SystemColors.Control;
wftl.BorderStyle = BorderStyle.None;
wftl.Dock = DockStyle.Fill;
});
Eto.Style.Add<Eto.Forms.Button>("main", button =>
{
var wfbutton = (Button)button.ControlObject;
});
Eto.Style.Add<Eto.Forms.Panel>("transparent-form", control =>
{
var wfwnd = (System.Windows.Forms.Form)control.ControlObject;
});
Eto.Style.Add<Eto.Forms.TextBox>("textbox-rightalign", control =>
{
var tbox = (System.Windows.Forms.TextBox)control.ControlObject;
tbox.TextAlign = HorizontalAlignment.Right;
});
Eto.Style.Add<Eto.Forms.GridView>("spreadsheet", control =>
{
var grid = (System.Windows.Forms.DataGridView)control.ControlObject;
grid.SelectionMode = DataGridViewSelectionMode.CellSelect;
grid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
grid.RowHeadersVisible = true;
grid.RowHeadersWidth = 50;
foreach (DataGridViewRow row in grid.Rows)
{
row.HeaderCell.Value = (row.Index + 1).ToString();
};
});
}
}
}