Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
4803dc00
Commit
4803dc00
authored
Oct 29, 2021
by
tr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、主界面Tab控件升级
parent
0b448a00
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
431 additions
and
55 deletions
+431
-55
TabControlEx.Designer.cs
Tools/MyControls/TabControlEx.Designer.cs
+38
-0
TabControlEx.cs
Tools/MyControls/TabControlEx.cs
+191
-0
TabControlEx.resx
Tools/MyControls/TabControlEx.resx
+123
-0
Tools.csproj
Tools/Tools.csproj
+9
-0
wMain.Designer.cs
Tools/wMain.Designer.cs
+51
-45
wMain.cs
Tools/wMain.cs
+13
-7
wMain.resx
Tools/wMain.resx
+6
-3
No files found.
Tools/MyControls/TabControlEx.Designer.cs
0 → 100644
View file @
4803dc00
namespace
Common.controls
{
partial
class
TabControlEx
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private
System
.
ComponentModel
.
IContainer
components
=
null
;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected
override
void
Dispose
(
bool
disposing
)
{
if
(
disposing
&&
(
components
!=
null
))
{
components
.
Dispose
();
}
base
.
Dispose
(
disposing
);
}
#
region
组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private
void
InitializeComponent
()
{
this
.
SuspendLayout
();
this
.
ResumeLayout
(
false
);
}
#
endregion
}
}
Tools/MyControls/TabControlEx.cs
0 → 100644
View file @
4803dc00
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Data
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
Common.controls
{
/// <summary>
/// Tab控件扩展
/// </summary>
[
ToolboxBitmap
(
typeof
(
TabControl
)),
Description
(
"选项卡"
)]
public
partial
class
TabControlEx
:
TabControl
{
/// <summary>
/// [构造] Tab控件扩展
/// </summary>
public
TabControlEx
()
{
InitializeComponent
();
//绘制样式
this
.
SetStyle
(
ControlStyles
.
UserPaint
//控件将自行绘制,而不是通过操作系统来绘制,重写OnPaint()方法
|
ControlStyles
.
OptimizedDoubleBuffer
//该控件首先在缓冲区中绘制,而不是直接绘制到屏幕上,这样可以减少闪烁
|
ControlStyles
.
AllPaintingInWmPaint
//控件将忽略 WM_ERASEBKGND 窗口消息以减少闪烁
|
ControlStyles
.
ResizeRedraw
//在调整控件大小时重绘控件
|
ControlStyles
.
SupportsTransparentBackColor
//控件接受 alpha 组件小于 255 的 BackColor 以模拟透明
,
true
);
//默认微软雅黑, 9 号字体
this
.
Font
=
new
Font
(
"微软雅黑"
,
9
);
}
/// <summary>
/// 控件-背景色
/// </summary>
public
Color
BackgroundColor
{
get
;
set
;
}
=
Color
.
White
;
/// <summary>
/// 激活标签-背景色
/// </summary>
public
Color
TabActivedBackColor
{
get
;
set
;
}
=
Color
.
FromArgb
(
41
,
101
,
204
);
/// <summary>
/// 非激活标签-背景色
/// </summary>
public
Color
TabDeactivedBackColor
{
get
;
set
;
}
=
Color
.
FromArgb
(
246
,
247
,
254
);
/// <summary>
/// 非激活标签-鼠标悬停背景色
/// </summary>
public
Color
TabDeactivedBackColorHover
{
get
;
set
;
}
=
Color
.
LightGreen
;
/// <summary>
/// 激活标签-字体颜色
/// </summary>
public
Color
TabActivedFontColor
{
get
;
set
;
}
=
Color
.
FromArgb
(
250
,
250
,
250
);
/// <summary>
/// 非激活标签-字体颜色
/// </summary>
public
Color
TabDeactivedFontColor
{
get
;
set
;
}
=
Color
.
FromArgb
(
55
,
55
,
55
);
/// <summary>
/// 非激活标签-鼠标滑过字体颜色
/// </summary>
public
Color
TabDeactivedFontColorHover
{
get
;
set
;
}
=
Color
.
FromArgb
(
55
,
55
,
55
);
/// <summary>
/// 标签-文本格式
/// </summary>
StringFormat
fmt
=
new
StringFormat
{
Alignment
=
StringAlignment
.
Center
,
LineAlignment
=
StringAlignment
.
Center
};
/// <summary>
/// 重写:绘制背景
/// </summary>
/// <param name="e"></param>
protected
override
void
OnPaintBackground
(
PaintEventArgs
e
)
{
//绘制控件背景
var
brush
=
new
SolidBrush
(
this
.
BackgroundColor
);
e
.
Graphics
.
FillRectangle
(
brush
,
e
.
ClipRectangle
);
}
/// <summary>
/// 重写:绘制方法
/// </summary>
/// <param name="e"></param>
protected
override
void
OnPaint
(
PaintEventArgs
e
)
{
var
g
=
e
.
Graphics
;
var
pos
=
this
.
PointToClient
(
Cursor
.
Position
);
//光标位置,用于悬停判断
//绘制标签项
for
(
int
index
=
0
;
index
<
this
.
TabPages
.
Count
;
index
++)
{
var
tabRect
=
this
.
GetTabRect
(
index
);
var
isHover
=
tabRect
.
Contains
(
pos
);
//选中颜色设定
var
IsSelected
=
this
.
SelectedIndex
.
Equals
(
index
);
var
BackColor
=
IsSelected
?
TabActivedBackColor
:
isHover
?
TabDeactivedBackColorHover
:
TabDeactivedBackColor
;
var
FontColor
=
IsSelected
?
TabActivedFontColor
:
isHover
?
TabDeactivedFontColorHover
:
TabDeactivedFontColor
;
//画笔、画刷准备
var
backPen
=
new
Pen
(
BackColor
);
var
backBrush
=
new
SolidBrush
(
BackColor
);
var
fontBrush
=
new
SolidBrush
(
FontColor
);
//绘制并填充矩形框:背景
g
.
FillRectangle
(
backBrush
,
tabRect
);
//绘制标题
var
title
=
this
.
TabPages
[
index
].
Text
;
g
.
DrawString
(
title
,
this
.
Font
,
fontBrush
,
tabRect
,
this
.
fmt
);
//扩展:绘制肩线(每轮绘制一次)
if
(
index
==
0
)
{
Rectangle
client
=
this
.
ClientRectangle
;
var
x
=
client
.
X
;
var
y
=
client
.
Y
+
tabRect
.
Height
+
2
;
var
location
=
new
Point
(
x
+
2
,
y
);
//左右各留2像素
var
size
=
new
Size
(
client
.
Width
-
3
,
2
);
var
shoulder
=
new
Rectangle
(
location
,
size
);
var
shoulderBrush
=
new
SolidBrush
(
this
.
TabActivedBackColor
);
//肩线为激活颜色
g
.
FillRectangle
(
shoulderBrush
,
shoulder
);
}
}
//扩展:绘制标签项边框线
this
.
DrawTabsBorder
(
g
);
}
/// <summary>
/// 绘制所有标签边框
/// </summary>
/// <param name="g"></param>
private
void
DrawTabsBorder
(
Graphics
g
)
{
//先绘制未选中标签
for
(
int
index
=
0
;
index
<
this
.
TabPages
.
Count
;
index
++)
{
if
(
index
==
this
.
SelectedIndex
)
continue
;
this
.
DrawTabRectBorder
(
g
,
index
);
}
//最后绘制选中标签
this
.
DrawTabRectBorder
(
g
,
this
.
SelectedIndex
,
true
);
}
/// <summary>
/// 绘制单个标签边框
/// </summary>
/// <param name="g"></param>
/// <param name="rect"></param>
/// <param name="pen"></param>
private
void
DrawTabRectBorder
(
Graphics
g
,
int
index
,
bool
isSelected
=
false
)
{
if
(
index
<
0
)
return
;
var
rect
=
this
.
GetTabRect
(
index
);
var
apex
=
this
.
GetRectApex
(
rect
,
0
);
//绘制框线:上、左、右
var
color
=
isSelected
?
TabActivedBackColor
:
BackgroundColor
;
var
pen
=
new
Pen
(
color
)
{
Width
=
1
};
g
.
DrawLine
(
pen
,
apex
.
TopLeft
,
apex
.
TopRight
);
//上框线
g
.
DrawLine
(
pen
,
apex
.
TopLeft
,
new
Point
(
apex
.
BtmLeft
.
X
,
apex
.
BtmLeft
.
Y
-
1
));
//左框线 : 剪短1像素,避免刺到肩线
g
.
DrawLine
(
pen
,
apex
.
TopRight
,
new
Point
(
apex
.
BtmRight
.
X
,
apex
.
BtmRight
.
Y
-
1
));
//右框线
}
/// <summary>
/// 获取矩形框的顶点
/// </summary>
/// <param name="rect">矩形框</param>
/// <param name="padding">内边距</param>
/// <param name="topLeft"></param>
/// <param name="topRight"></param>
/// <param name="btmLeft"></param>
/// <param name="btmRight"></param>
private
dynamic
GetRectApex
(
Rectangle
rect
,
int
padding
)
{
//内边距不能小于0
padding
=
Math
.
Max
(
0
,
padding
);
//获取坐标位置
var
left_x
=
rect
.
X
+
padding
;
var
left_y
=
rect
.
Y
+
padding
;
var
right_x
=
left_x
+
rect
.
Width
-
padding
*
2
;
var
right_y
=
left_y
+
rect
.
Height
-
padding
*
2
;
//获取顶点位置
return
new
{
TopLeft
=
new
Point
(
left_x
,
left_y
),
TopRight
=
new
Point
(
right_x
,
left_y
),
BtmLeft
=
new
Point
(
left_x
,
right_y
),
BtmRight
=
new
Point
(
right_x
,
right_y
),
};
}
}
}
Tools/MyControls/TabControlEx.resx
0 → 100644
View file @
4803dc00
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:import
namespace=
"http://www.w3.org/XML/1998/namespace"
/>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
use=
"required"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<metadata
name=
"$this.TrayLargeIcon"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
False
</value>
</metadata>
</root>
\ No newline at end of file
Tools/Tools.csproj
View file @
4803dc00
...
...
@@ -99,6 +99,12 @@
<Compile
Include=
"MyCommon\wEditBasic.Designer.cs"
>
<DependentUpon>
wEditBasic.cs
</DependentUpon>
</Compile>
<Compile
Include=
"MyControls\TabControlEx.cs"
>
<SubType>
Component
</SubType>
</Compile>
<Compile
Include=
"MyControls\TabControlEx.Designer.cs"
>
<DependentUpon>
TabControlEx.cs
</DependentUpon>
</Compile>
<Compile
Include=
"MyData\AnlysisHelper.cs"
/>
<Compile
Include=
"MyData\DBHelper.cs"
/>
<Compile
Include=
"MyData\SqlHelper.cs"
/>
...
...
@@ -318,6 +324,9 @@
<EmbeddedResource
Include=
"MyCommon\wEditBasic.resx"
>
<DependentUpon>
wEditBasic.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"MyControls\TabControlEx.resx"
>
<DependentUpon>
TabControlEx.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"MyUtils\wDbSetting.resx"
>
<DependentUpon>
wDbSetting.cs
</DependentUpon>
</EmbeddedResource>
...
...
Tools/wMain.Designer.cs
View file @
4803dc00
...
...
@@ -34,9 +34,6 @@
this
.
splitContainer1
=
new
System
.
Windows
.
Forms
.
SplitContainer
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
imageList1
=
new
System
.
Windows
.
Forms
.
ImageList
(
this
.
components
);
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
HomePage
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
menuStrip1
=
new
System
.
Windows
.
Forms
.
MenuStrip
();
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tsmiSysUpload
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
...
...
@@ -65,16 +62,19 @@
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
toolTip1
=
new
System
.
Windows
.
Forms
.
ToolTip
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
tabControl1
=
new
Common
.
controls
.
TabControlEx
();
this
.
HomePage
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
panel1
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
splitContainer1
)).
BeginInit
();
this
.
splitContainer1
.
Panel1
.
SuspendLayout
();
this
.
splitContainer1
.
Panel2
.
SuspendLayout
();
this
.
splitContainer1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
HomePage
.
SuspendLayout
();
this
.
menuStrip1
.
SuspendLayout
();
this
.
Header
.
SuspendLayout
();
this
.
Footer
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
HomePage
.
SuspendLayout
();
this
.
SuspendLayout
();
//
// panel1
...
...
@@ -133,41 +133,6 @@
this
.
imageList1
.
Images
.
SetKeyName
(
3
,
"51_工作群组.png"
);
this
.
imageList1
.
Images
.
SetKeyName
(
4
,
"60_空间.png"
);
//
// tabControl1
//
this
.
tabControl1
.
Controls
.
Add
(
this
.
HomePage
);
this
.
tabControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
tabControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
494
,
369
);
this
.
tabControl1
.
TabIndex
=
0
;
this
.
toolTip1
.
SetToolTip
(
this
.
tabControl1
,
"双击关闭"
);
//
// HomePage
//
this
.
HomePage
.
Controls
.
Add
(
this
.
label5
);
this
.
HomePage
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
HomePage
.
Name
=
"HomePage"
;
this
.
HomePage
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
HomePage
.
Size
=
new
System
.
Drawing
.
Size
(
486
,
339
);
this
.
HomePage
.
TabIndex
=
0
;
this
.
HomePage
.
Text
=
"首页"
;
this
.
HomePage
.
UseVisualStyleBackColor
=
true
;
//
// label5
//
this
.
label5
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
label5
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
18F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label5
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
AppWorkspace
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
480
,
333
);
this
.
label5
.
TabIndex
=
0
;
this
.
label5
.
Text
=
"欢迎使用飞天兔工具平台"
;
this
.
label5
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// menuStrip1
//
this
.
menuStrip1
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
234
)))),
((
int
)(((
byte
)(
245
)))),
((
int
)(((
byte
)(
255
)))));
...
...
@@ -453,6 +418,47 @@
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// tabControl1
//
this
.
tabControl1
.
BackgroundColor
=
System
.
Drawing
.
Color
.
White
;
this
.
tabControl1
.
Controls
.
Add
(
this
.
HomePage
);
this
.
tabControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
tabControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
494
,
369
);
this
.
tabControl1
.
TabActivedBackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
41
)))),
((
int
)(((
byte
)(
101
)))),
((
int
)(((
byte
)(
204
)))));
this
.
tabControl1
.
TabActivedFontColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
250
)))),
((
int
)(((
byte
)(
250
)))),
((
int
)(((
byte
)(
250
)))));
this
.
tabControl1
.
TabDeactivedBackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
246
)))),
((
int
)(((
byte
)(
247
)))),
((
int
)(((
byte
)(
254
)))));
this
.
tabControl1
.
TabDeactivedBackColorHover
=
System
.
Drawing
.
Color
.
LightGreen
;
this
.
tabControl1
.
TabDeactivedFontColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
55
)))),
((
int
)(((
byte
)(
55
)))),
((
int
)(((
byte
)(
55
)))));
this
.
tabControl1
.
TabDeactivedFontColorHover
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
55
)))),
((
int
)(((
byte
)(
55
)))),
((
int
)(((
byte
)(
55
)))));
this
.
tabControl1
.
TabIndex
=
0
;
//
// HomePage
//
this
.
HomePage
.
Controls
.
Add
(
this
.
label5
);
this
.
HomePage
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
HomePage
.
Name
=
"HomePage"
;
this
.
HomePage
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
HomePage
.
Size
=
new
System
.
Drawing
.
Size
(
486
,
339
);
this
.
HomePage
.
TabIndex
=
0
;
this
.
HomePage
.
Text
=
"首页"
;
this
.
HomePage
.
UseVisualStyleBackColor
=
true
;
//
// label5
//
this
.
label5
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
label5
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
18F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label5
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
AppWorkspace
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
480
,
333
);
this
.
label5
.
TabIndex
=
4
;
this
.
label5
.
Text
=
"欢迎使用飞天兔工具平台"
;
this
.
label5
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// wMain
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
@@ -464,19 +470,19 @@
this
.
Name
=
"wMain"
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterScreen
;
this
.
Text
=
"工具平台"
;
this
.
FormClosing
+=
new
System
.
Windows
.
Forms
.
FormClosingEventHandler
(
this
.
w
Main_FormClosing
);
this
.
FormClosing
+=
new
System
.
Windows
.
Forms
.
FormClosingEventHandler
(
this
.
W
Main_FormClosing
);
this
.
panel1
.
ResumeLayout
(
false
);
this
.
panel1
.
PerformLayout
();
this
.
splitContainer1
.
Panel1
.
ResumeLayout
(
false
);
this
.
splitContainer1
.
Panel2
.
ResumeLayout
(
false
);
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
splitContainer1
)).
EndInit
();
this
.
splitContainer1
.
ResumeLayout
(
false
);
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
HomePage
.
ResumeLayout
(
false
);
this
.
menuStrip1
.
ResumeLayout
(
false
);
this
.
menuStrip1
.
PerformLayout
();
this
.
Header
.
ResumeLayout
(
false
);
this
.
Footer
.
ResumeLayout
(
false
);
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
HomePage
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
}
...
...
@@ -506,8 +512,6 @@
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
Label
lbSysLoginUser
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
tsmiHelpAboutUs
;
private
System
.
Windows
.
Forms
.
TabControl
tabControl1
;
private
System
.
Windows
.
Forms
.
TabPage
HomePage
;
private
System
.
Windows
.
Forms
.
ListView
listView1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
tsmiAccPasswordMgr
;
private
System
.
Windows
.
Forms
.
ImageList
imageList1
;
...
...
@@ -517,6 +521,8 @@
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
tsmiSysUpdateLog
;
private
Common
.
controls
.
TabControlEx
tabControl1
;
private
System
.
Windows
.
Forms
.
TabPage
HomePage
;
private
System
.
Windows
.
Forms
.
Label
label5
;
}
}
\ No newline at end of file
Tools/wMain.cs
View file @
4803dc00
...
...
@@ -41,11 +41,11 @@ namespace Tools
//重置窗体大小
this
.
SetWinMinimized
();
//窗体基本事件
this
.
Load
+=
WMain
View
_Load
;
this
.
Shown
+=
WMain
View
_Shown
;
this
.
Load
+=
WMain_Load
;
this
.
Shown
+=
WMain_Shown
;
}
private
void
WMain
View
_Load
(
object
sender
,
EventArgs
e
)
private
void
WMain_Load
(
object
sender
,
EventArgs
e
)
{
//初始化数据库链接
var
link
=
Utils
.
GetDbLinkString204
(
"FTT_Work"
);
...
...
@@ -55,7 +55,7 @@ namespace Tools
//渲染菜单
this
.
RenderMenu
();
}
private
void
WMain
View
_Shown
(
object
sender
,
EventArgs
e
)
private
void
WMain_Shown
(
object
sender
,
EventArgs
e
)
{
//窗体拖拽事件
this
.
Header
.
MouseDown
+=
Header_MouseDown
;
...
...
@@ -71,6 +71,8 @@ namespace Tools
}
}
//用TabControl模拟MDI效果
//扩展:选项卡激活对比颜色设置
this
.
tabControl1
.
ShowToolTips
=
true
;
this
.
tabControl1
.
SelectedIndexChanged
+=
TabControl1_SelectedIndexChanged
;
this
.
tabControl1
.
MouseDoubleClick
+=
TabControl1_MouseDoubleClick
;
//用户登录
...
...
@@ -93,8 +95,7 @@ namespace Tools
this
.
lbSysVersion
.
Text
=
dt
.
DefaultView
.
Count
==
0
?
$"2021.0.1"
:
$"
{
dt
.
DefaultView
[
0
][
0
]}
"
;
}));
}
private
void
wMain_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
private
void
WMain_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
this
.
_db
=
null
;
//this.webBrowser1.Hide();
...
...
@@ -369,6 +370,7 @@ namespace Tools
{
Parent
=
this
.
tabControl1
,
BackColor
=
Color
.
White
,
ToolTipText
=
"双击关闭"
,
};
//挂载窗体
var
frm
=
Activator
.
CreateInstance
(
item
.
Tag
as
Type
)
as
Form
;
...
...
@@ -404,6 +406,8 @@ namespace Tools
/// <param name="e"></param>
private
void
TabControl1_MouseDoubleClick
(
object
sender
,
MouseEventArgs
e
)
{
if
(
e
.
Button
!=
MouseButtons
.
Left
)
return
;
this
.
CloseModule
(
this
.
tabControl1
.
SelectedTab
);
}
/// <summary>
...
...
@@ -433,7 +437,9 @@ namespace Tools
#
endregion
#
region
扩展:登录及权限
//登录人员点击
/// <summary>
/// 登录人员点击
/// </summary>
private
void
LbSysLoginUser_Click
(
object
sender
,
EventArgs
e
)
{
if
(
this
.
ShowLoginWindow
())
...
...
Tools/wMain.resx
View file @
4803dc00
...
...
@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD0
EgAAAk1TRnQBSQFMAgEBBQEAA
aABAAGg
AQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
EgAAAk1TRnQBSQFMAgEBBQEAA
bABAAGw
AQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABgAMAAUADAAEBAQABCAYAASAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
...
...
@@ -208,11 +208,14 @@
Av8BgAEBAv8B4AEHAv8B4AEHAv8B4AEHAv8B4AEHAv8B/gF/Av8B/gF/Av8B/gF/Av8B/AE/Mf8L
</value>
</data>
<metadata
name=
"menuStrip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
478, 17
</value>
</metadata>
<metadata
name=
"toolTip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
713, 17
</value>
</metadata>
<metadata
name=
"
menuStr
ip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
478
, 17
</value>
<metadata
name=
"
toolT
ip1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
713
, 17
</value>
</metadata>
<metadata
name=
"timer1.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
814, 17
</value>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment