FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MapWindow5/src/MW5.Tools/Helpers/TabControlHelper.cs at develop · MapWindow/MapWindow5 · GitHub
MapWindow
/
MapWindow5
Public
Notifications
You must be signed in to change notification settings
Fork
102
Star
308
Code
Issues
14
Pull requests
12
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MapWindow5
/
src
/
MW5.Tools
/
Helpers
/
TabControlHelper.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (64 loc) · 2.52 KB
Breadcrumbs
MapWindow5
/
src
/
MW5.Tools
/
Helpers
/
TabControlHelper.cs
Copy path
File metadata and controls
73 lines (64 loc) · 2.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
// -------------------------------------------------------------------------------------------
// <copyright file="TabControlHelper.cs" company="MapWindow OSS Team - www.mapwindow.org">
// MapWindow OSS Team - 2015
// </copyright>
// -------------------------------------------------------------------------------------------
using
System
.
Drawing
;
using
System
.
Windows
.
Forms
;
using
Syncfusion
.
Windows
.
Forms
.
Tools
;
namespace
MW5
.
Tools
.
Helpers
{
/// <summary>
/// Extension method to deal with the standard ToolView tab control.
/// </summary>
internal
static
class
TabControlHelper
{
/// <summary>
/// Adds new tab page to the control.
/// </summary>
public
static
TabPageAdv
AddTab
(
this
TabControlAdv
tabControl
,
string
caption
,
Bitmap
icon
)
{
var
page
=
tabControl
.
TabPages
[
tabControl
.
TabPages
.
Count
-
1
]
;
return
AddTab
(
tabControl
,
caption
,
icon
,
page
)
;
}
/// <summary>
/// Gets panel within the tab page.
/// </summary>
public
static
Panel
GetPanel
(
this
TabPageAdv
tab
)
{
return
tab
.
Controls
[
0
]
as
Panel
;
}
/// <summary>
/// Adds new tab page to the control and adds it before specified page.
/// </summary>
private
static
TabPageAdv
AddTab
(
this
TabControlAdv
tabControl
,
string
caption
,
Bitmap
icon
,
TabPageAdv
insertBefore
)
{
var
tab
=
new
TabPageAdv
(
caption
)
{
Image
=
icon
,
ImageSize
=
new
Size
(
24
,
24
)
,
Location
=
new
Point
(
123
,
1
)
,
ShowCloseButton
=
true
,
ThemesEnabled
=
false
}
;
// insert panel with autoscrolling, which will serve as a container for controls
var
panel
=
new
Panel
{
AutoScroll
=
true
,
Dock
=
DockStyle
.
Fill
,
Location
=
new
Point
(
0
,
0
)
,
Padding
=
new
Padding
(
20
,
10
,
20
,
25
)
,
Size
=
new
Size
(
425
,
387
)
,
}
;
tab
.
Controls
.
Add
(
panel
)
;
int
index
=
tabControl
.
TabPages
.
IndexOf
(
insertBefore
)
;
// insert before the help page
tabControl
.
TabPages
.
Insert
(
index
,
tab
)
;
return
tab
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL