Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b1f7ed3f
由
HZH
编写于
2019-09-30 11:21:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加内置颜色
1 个父辈
44e0deea
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
740 行增加
和
29 行删除
HZH_Controls/HZH_Controls/Colors/BasisColors.cs
HZH_Controls/HZH_Controls/Colors/BorderColors.cs
HZH_Controls/HZH_Controls/Colors/ColorEnums.cs
HZH_Controls/HZH_Controls/Colors/ColorExt.cs
HZH_Controls/HZH_Controls/Colors/GradientColors.cs
HZH_Controls/HZH_Controls/Colors/LineColors.cs
HZH_Controls/HZH_Controls/Colors/StatusColors.cs
HZH_Controls/HZH_Controls/Colors/TableColors.cs
HZH_Controls/HZH_Controls/Colors/TextColors.cs
HZH_Controls/HZH_Controls/Forms/FrmAnchorTips.cs
HZH_Controls/HZH_Controls/Forms/FrmTips.cs
HZH_Controls/HZH_Controls/HZH_Controls.csproj
HZH_Controls/HZH_Controls/Colors/BasisColors.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Drawing
;
namespace
HZH_Controls
{
public
class
BasisColors
{
private
static
Color
light
=
ColorTranslator
.
FromHtml
(
"#f5f7fa"
);
public
static
Color
Light
{
get
{
return
light
;
}
internal
set
{
light
=
value
;
}
}
private
static
Color
medium
=
ColorTranslator
.
FromHtml
(
"#f0f2f5"
);
public
static
Color
Medium
{
get
{
return
medium
;
}
internal
set
{
medium
=
value
;
}
}
private
static
Color
dark
=
ColorTranslator
.
FromHtml
(
"#000000"
);
public
static
Color
Dark
{
get
{
return
dark
;
}
internal
set
{
dark
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Colors/BorderColors.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
public
class
BorderColors
{
private
static
Color
green
=
ColorTranslator
.
FromHtml
(
"#f0f9ea"
);
public
static
Color
Green
{
get
{
return
green
;
}
internal
set
{
green
=
value
;
}
}
private
static
Color
blue
=
ColorTranslator
.
FromHtml
(
"#ecf5ff"
);
public
static
Color
Blue
{
get
{
return
blue
;
}
internal
set
{
blue
=
value
;
}
}
private
static
Color
red
=
ColorTranslator
.
FromHtml
(
"#fef0f0"
);
public
static
Color
Red
{
get
{
return
red
;
}
internal
set
{
red
=
value
;
}
}
private
static
Color
yellow
=
ColorTranslator
.
FromHtml
(
"#fdf5e6"
);
public
static
Color
Yellow
{
get
{
return
yellow
;
}
internal
set
{
yellow
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Colors/ColorEnums.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
public
enum
BasisColorsTypes
{
Light
,
Medium
,
Dark
}
public
enum
BorderColorsTypes
{
Green
,
Blue
,
Red
,
Yellow
}
public
enum
GradientColorsTypes
{
Orange
,
LightGreen
,
Green
,
Blue
,
BlueGreen
,
LightViolet
,
Violet
,
Gray
}
public
enum
LineColorsTypes
{
MoreLight
,
Light
,
Dark
,
MoreDark
}
public
enum
StatusColorsTypes
{
Primary
,
Success
,
Warning
,
Danger
,
Info
}
public
enum
TableColorsTypes
{
Green
,
Blue
,
Red
,
Yellow
,
Gray
}
public
enum
TextColorsTypes
{
MoreLight
,
Light
,
Dark
,
MoreDark
}
}
HZH_Controls/HZH_Controls/Colors/ColorExt.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
public
static
class
ColorExt
{
#
region
重置内置的颜色
English
:
Reset
color
public
static
void
ResetColor
(
this
BasisColors
type
,
Color
light
,
Color
medium
,
Color
dark
)
{
BasisColors
.
Light
=
light
;
BasisColors
.
Medium
=
medium
;
BasisColors
.
Dark
=
dark
;
}
public
static
void
ResetColor
(
this
BorderColors
type
,
Color
green
,
Color
blue
,
Color
red
,
Color
yellow
)
{
BorderColors
.
Green
=
green
;
BorderColors
.
Blue
=
blue
;
BorderColors
.
Red
=
red
;
BorderColors
.
Yellow
=
yellow
;
}
public
static
void
ResetColor
(
this
GradientColors
type
,
Color
[]
orange
,
Color
[]
lightGreen
,
Color
[]
green
,
Color
[]
blue
,
Color
[]
blueGreen
,
Color
[]
lightViolet
,
Color
[]
violet
,
Color
[]
gray
)
{
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
Orange
=
orange
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
LightGreen
=
lightGreen
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
Green
=
green
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
Blue
=
blue
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
BlueGreen
=
blueGreen
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
LightViolet
=
lightViolet
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
Violet
=
violet
;
if
(
orange
!=
null
&&
orange
.
Length
==
2
)
GradientColors
.
Gray
=
gray
;
}
public
static
void
ResetColor
(
this
LineColors
type
,
Color
moreLight
,
Color
light
,
Color
dark
,
Color
moreDark
)
{
LineColors
.
MoreLight
=
moreLight
;
LineColors
.
Light
=
light
;
LineColors
.
Dark
=
dark
;
LineColors
.
MoreDark
=
moreDark
;
}
public
static
void
ResetColor
(
this
StatusColors
type
,
Color
primary
,
Color
success
,
Color
warning
,
Color
danger
,
Color
info
)
{
StatusColors
.
Primary
=
primary
;
StatusColors
.
Success
=
success
;
StatusColors
.
Warning
=
warning
;
StatusColors
.
Danger
=
danger
;
StatusColors
.
Info
=
info
;
}
public
static
void
ResetColor
(
this
TableColors
type
,
Color
green
,
Color
blue
,
Color
red
,
Color
yellow
,
Color
gray
)
{
TableColors
.
Green
=
green
;
TableColors
.
Blue
=
blue
;
TableColors
.
Red
=
red
;
TableColors
.
Yellow
=
yellow
;
TableColors
.
Gray
=
gray
;
}
public
static
void
ResetColor
(
this
TextColors
type
,
Color
moreLight
,
Color
light
,
Color
dark
,
Color
moreDark
)
{
TextColors
.
MoreLight
=
moreLight
;
TextColors
.
Light
=
light
;
TextColors
.
Dark
=
dark
;
TextColors
.
MoreDark
=
moreDark
;
}
#
endregion
#
region
获取一个内置颜色
English
:
Get
a
built
-
in
color
/// <summary>
/// 功能描述:获取一个内置颜色 English:Get a built-in color
/// 作 者:HZH
/// 创建日期:2019-09-30 11:08:04
/// 任务编号:POS
/// </summary>
/// <param name="t">t</param>
/// <returns>颜色列表</returns>
public
static
Color
[]
GetInternalColor
<
T
>(
T
t
)
{
Type
type
=
null
;
if
(
t
is
BasisColorsTypes
)
{
type
=
typeof
(
BasisColors
);
}
if
(
type
==
null
)
return
new
Color
[]
{
Color
.
Empty
};
else
{
string
strName
=
t
.
ToString
();
var
pi
=
type
.
GetProperty
(
strName
);
if
(
pi
==
null
)
return
new
Color
[]
{
Color
.
Empty
};
else
{
var
c
=
pi
.
GetValue
(
null
,
null
);
if
(
c
==
null
)
return
new
Color
[]
{
Color
.
Empty
};
else
if
(
c
is
Color
[])
return
(
Color
[])
c
;
else
return
new
Color
[]
{
(
Color
)
c
};
}
}
}
#
endregion
}
}
HZH_Controls/HZH_Controls/Colors/GradientColors.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
public
class
GradientColors
{
private
static
Color
[]
orange
=
new
Color
[]
{
Color
.
FromArgb
(
252
,
196
,
136
),
Color
.
FromArgb
(
243
,
138
,
159
)
};
public
static
Color
[]
Orange
{
get
{
return
GradientColors
.
orange
;
}
internal
set
{
GradientColors
.
orange
=
value
;
}
}
private
static
Color
[]
lightGreen
=
new
Color
[]
{
Color
.
FromArgb
(
210
,
251
,
123
),
Color
.
FromArgb
(
152
,
231
,
160
)
};
public
static
Color
[]
LightGreen
{
get
{
return
GradientColors
.
lightGreen
;
}
internal
set
{
GradientColors
.
lightGreen
=
value
;
}
}
private
static
Color
[]
green
=
new
Color
[]
{
Color
.
FromArgb
(
138
,
241
,
124
),
Color
.
FromArgb
(
32
,
190
,
179
)
};
public
static
Color
[]
Green
{
get
{
return
GradientColors
.
green
;
}
internal
set
{
GradientColors
.
green
=
value
;
}
}
private
static
Color
[]
blue
=
new
Color
[]
{
Color
.
FromArgb
(
193
,
232
,
251
),
Color
.
FromArgb
(
162
,
197
,
253
)
};
public
static
Color
[]
Blue
{
get
{
return
GradientColors
.
blue
;
}
internal
set
{
GradientColors
.
blue
=
value
;
}
}
private
static
Color
[]
blueGreen
=
new
Color
[]
{
Color
.
FromArgb
(
122
,
251
,
218
),
Color
.
FromArgb
(
16
,
193
,
252
)
};
public
static
Color
[]
BlueGreen
{
get
{
return
GradientColors
.
blueGreen
;
}
internal
set
{
GradientColors
.
blueGreen
=
value
;
}
}
private
static
Color
[]
lightViolet
=
new
Color
[]
{
Color
.
FromArgb
(
248
,
192
,
234
),
Color
.
FromArgb
(
164
,
142
,
210
)
};
public
static
Color
[]
LightViolet
{
get
{
return
GradientColors
.
lightViolet
;
}
internal
set
{
GradientColors
.
lightViolet
=
value
;
}
}
private
static
Color
[]
violet
=
new
Color
[]
{
Color
.
FromArgb
(
185
,
154
,
241
),
Color
.
FromArgb
(
137
,
124
,
242
)
};
public
static
Color
[]
Violet
{
get
{
return
GradientColors
.
violet
;
}
internal
set
{
GradientColors
.
violet
=
value
;
}
}
private
static
Color
[]
gray
=
new
Color
[]
{
Color
.
FromArgb
(
233
,
238
,
239
),
Color
.
FromArgb
(
147
,
162
,
175
)
};
public
static
Color
[]
Gray
{
get
{
return
GradientColors
.
gray
;
}
internal
set
{
GradientColors
.
gray
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Colors/LineColors.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
public
class
LineColors
{
/// <summary>
/// The more light
/// </summary>
private
static
Color
_MoreLight
=
ColorTranslator
.
FromHtml
(
"#f2f6fc"
);
/// <summary>
/// Gets the more light.
/// </summary>
/// <value>The more light.</value>
public
static
Color
MoreLight
{
get
{
return
_MoreLight
;
}
internal
set
{
_MoreLight
=
value
;
}
}
/// <summary>
/// The light
/// </summary>
private
static
Color
_Light
=
ColorTranslator
.
FromHtml
(
"#ebeef5"
);
/// <summary>
/// Gets the light.
/// </summary>
/// <value>The light.</value>
public
static
Color
Light
{
get
{
return
_Light
;
}
internal
set
{
_Light
=
value
;
}
}
/// <summary>
/// The dark
/// </summary>
private
static
Color
_Dark
=
ColorTranslator
.
FromHtml
(
"#e4e7ed"
);
/// <summary>
/// Gets the dark.
/// </summary>
/// <value>The dark.</value>
public
static
Color
Dark
{
get
{
return
_Dark
;
}
internal
set
{
_Dark
=
value
;
}
}
/// <summary>
/// The more dark
/// </summary>
private
static
Color
_MoreDark
=
ColorTranslator
.
FromHtml
(
"#dcdfe6"
);
/// <summary>
/// Gets the more dark.
/// </summary>
/// <value>The more dark.</value>
public
static
Color
MoreDark
{
get
{
return
_MoreDark
;
}
internal
set
{
_MoreDark
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Colors/StatusColors.cs
0 → 100644
查看文件 @
b1f7ed3
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 2019-09-30
//
// ***********************************************************************
// <copyright file="StatusColor.cs">
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
// </copyright>
//
// Blog: https://www.cnblogs.com/bfyx
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
//
// If you use this code, please keep this note.
// ***********************************************************************
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
/// <summary>
/// 状态颜色
/// </summary>
public
class
StatusColors
{
/// <summary>
/// The primary
/// </summary>
private
static
Color
_Primary
=
ColorTranslator
.
FromHtml
(
"#409eff"
);
/// <summary>
/// Gets or sets the primary.
/// </summary>
/// <value>The primary.</value>
public
static
Color
Primary
{
get
{
return
_Primary
;
}
internal
set
{
_Primary
=
value
;
}
}
/// <summary>
/// The success
/// </summary>
private
static
Color
_Success
=
ColorTranslator
.
FromHtml
(
"#67c23a"
);
/// <summary>
/// Gets or sets the success.
/// </summary>
/// <value>The success.</value>
public
static
Color
Success
{
get
{
return
_Success
;
}
internal
set
{
_Success
=
value
;
}
}
/// <summary>
/// The warning
/// </summary>
private
static
Color
_Warning
=
ColorTranslator
.
FromHtml
(
"#e6a23c"
);
/// <summary>
/// Gets or sets the warning.
/// </summary>
/// <value>The warning.</value>
public
static
Color
Warning
{
get
{
return
_Warning
;
}
internal
set
{
_Warning
=
value
;
}
}
/// <summary>
/// The danger
/// </summary>
private
static
Color
_Danger
=
ColorTranslator
.
FromHtml
(
"#f56c6c"
);
/// <summary>
/// Gets or sets the danger.
/// </summary>
/// <value>The danger.</value>
public
static
Color
Danger
{
get
{
return
_Danger
;
}
internal
set
{
_Danger
=
value
;
}
}
/// <summary>
/// The information
/// </summary>
private
static
Color
_Info
=
ColorTranslator
.
FromHtml
(
"#909399"
);
/// <summary>
/// Gets or sets the information.
/// </summary>
/// <value>The information.</value>
public
static
Color
Info
{
get
{
return
_Info
;
}
internal
set
{
_Info
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Colors/TableColors.cs
0 → 100644
查看文件 @
b1f7ed3
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
public
class
TableColors
{
private
static
Color
green
=
ColorTranslator
.
FromHtml
(
"#c2e7b0"
);
public
static
Color
Green
{
get
{
return
green
;
}
internal
set
{
green
=
value
;
}
}
private
static
Color
blue
=
ColorTranslator
.
FromHtml
(
"#a3d0fd"
);
public
static
Color
Blue
{
get
{
return
blue
;
}
internal
set
{
blue
=
value
;
}
}
private
static
Color
red
=
ColorTranslator
.
FromHtml
(
"#fbc4c4"
);
public
static
Color
Red
{
get
{
return
red
;
}
internal
set
{
red
=
value
;
}
}
private
static
Color
yellow
=
ColorTranslator
.
FromHtml
(
"#f5dab1"
);
public
static
Color
Yellow
{
get
{
return
yellow
;
}
internal
set
{
yellow
=
value
;
}
}
private
static
Color
gray
=
ColorTranslator
.
FromHtml
(
"#d3d4d6"
);
public
static
Color
Gray
{
get
{
return
gray
;
}
internal
set
{
gray
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Colors/TextColors.cs
0 → 100644
查看文件 @
b1f7ed3
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 2019-09-30
//
// ***********************************************************************
// <copyright file="TextColor.cs">
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
// </copyright>
//
// Blog: https://www.cnblogs.com/bfyx
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
//
// If you use this code, please keep this note.
// ***********************************************************************
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls
{
/// <summary>
/// Class TextColor.
/// </summary>
public
class
TextColors
{
/// <summary>
/// The more light
/// </summary>
private
static
Color
_MoreLight
=
ColorTranslator
.
FromHtml
(
"#c0c4cc"
);
/// <summary>
/// Gets the more light.
/// </summary>
/// <value>The more light.</value>
public
static
Color
MoreLight
{
get
{
return
_MoreLight
;
}
internal
set
{
_MoreLight
=
value
;
}
}
/// <summary>
/// The light
/// </summary>
private
static
Color
_Light
=
ColorTranslator
.
FromHtml
(
"#909399"
);
/// <summary>
/// Gets the light.
/// </summary>
/// <value>The light.</value>
public
static
Color
Light
{
get
{
return
_Light
;
}
internal
set
{
_Light
=
value
;
}
}
/// <summary>
/// The dark
/// </summary>
private
static
Color
_Dark
=
ColorTranslator
.
FromHtml
(
"#606266"
);
/// <summary>
/// Gets the dark.
/// </summary>
/// <value>The dark.</value>
public
static
Color
Dark
{
get
{
return
_Dark
;
}
internal
set
{
_Dark
=
value
;
}
}
/// <summary>
/// The more dark
/// </summary>
private
static
Color
_MoreDark
=
ColorTranslator
.
FromHtml
(
"#303133"
);
/// <summary>
/// Gets the more dark.
/// </summary>
/// <value>The more dark.</value>
public
static
Color
MoreDark
{
get
{
return
_MoreDark
;
}
internal
set
{
_MoreDark
=
value
;
}
}
}
}
HZH_Controls/HZH_Controls/Forms/FrmAnchorTips.cs
查看文件 @
b1f7ed3
...
@@ -244,7 +244,7 @@ namespace HZH_Controls.Forms
...
@@ -244,7 +244,7 @@ namespace HZH_Controls.Forms
Graphics
gBit
=
Graphics
.
FromImage
(
bit
);
Graphics
gBit
=
Graphics
.
FromImage
(
bit
);
gBit
.
SetGDIHigh
();
gBit
.
SetGDIHigh
();
gBit
.
FillPath
(
new
SolidBrush
(
_background
),
path
);
gBit
.
FillPath
(
new
SolidBrush
(
_background
),
path
);
gBit
.
DrawString
(
strMsg
,
_font
,
new
SolidBrush
(
_foreColor
),
rect
,
new
StringFormat
()
{
Alignment
=
StringAlignment
.
Center
,
LineAlignment
=
StringAlignment
.
Center
});
gBit
.
DrawString
(
strMsg
,
_font
,
new
SolidBrush
(
_foreColor
),
rect
,
new
StringFormat
()
{
Alignment
=
StringAlignment
.
Center
,
LineAlignment
=
StringAlignment
.
Center
});
gBit
.
Dispose
();
gBit
.
Dispose
();
#
endregion
#
endregion
...
@@ -256,7 +256,7 @@ namespace HZH_Controls.Forms
...
@@ -256,7 +256,7 @@ namespace HZH_Controls.Forms
/// <summary>
/// <summary>
/// Shows the tips.
/// Shows the tips.
/// </summary>
/// </summary>
/// <param name="
parent
Control">The parent control.</param>
/// <param name="
anchor
Control">The parent control.</param>
/// <param name="strMsg">The string MSG.</param>
/// <param name="strMsg">The string MSG.</param>
/// <param name="location">The location.</param>
/// <param name="location">The location.</param>
/// <param name="background">The background.</param>
/// <param name="background">The background.</param>
...
@@ -267,7 +267,7 @@ namespace HZH_Controls.Forms
...
@@ -267,7 +267,7 @@ namespace HZH_Controls.Forms
/// <param name="blnTopMost">是否置顶</param>
/// <param name="blnTopMost">是否置顶</param>
/// <returns>FrmAnchorTips.</returns>
/// <returns>FrmAnchorTips.</returns>
public
static
FrmAnchorTips
ShowTips
(
public
static
FrmAnchorTips
ShowTips
(
Control
parent
Control
,
Control
anchor
Control
,
string
strMsg
,
string
strMsg
,
AnchorTipsLocation
location
=
AnchorTipsLocation
.
RIGHT
,
AnchorTipsLocation
location
=
AnchorTipsLocation
.
RIGHT
,
Color
?
background
=
null
,
Color
?
background
=
null
,
...
@@ -275,22 +275,22 @@ namespace HZH_Controls.Forms
...
@@ -275,22 +275,22 @@ namespace HZH_Controls.Forms
Size
?
deviation
=
null
,
Size
?
deviation
=
null
,
int
fontSize
=
10
,
int
fontSize
=
10
,
int
autoCloseTime
=
5000
,
int
autoCloseTime
=
5000
,
bool
blnTopMost
=
true
)
bool
blnTopMost
=
true
)
{
{
Point
p
;
Point
p
;
if
(
parent
Control
is
Form
)
if
(
anchor
Control
is
Form
)
{
{
p
=
parent
Control
.
Location
;
p
=
anchor
Control
.
Location
;
}
}
else
else
{
{
p
=
parentControl
.
Parent
.
PointToScreen
(
parent
Control
.
Location
);
p
=
anchorControl
.
Parent
.
PointToScreen
(
anchor
Control
.
Location
);
}
}
if
(
deviation
!=
null
)
if
(
deviation
!=
null
)
{
{
p
=
p
+
deviation
.
Value
;
p
=
p
+
deviation
.
Value
;
}
}
return
ShowTips
(
new
Rectangle
(
p
,
parentControl
.
Size
),
strMsg
,
location
,
background
,
foreColor
,
fontSize
,
autoCloseTime
,
parentControl
.
FindForm
(),
blnTopMost
);
return
ShowTips
(
new
Rectangle
(
p
,
anchorControl
.
Size
),
strMsg
,
location
,
background
,
foreColor
,
fontSize
,
autoCloseTime
,
anchorControl
.
Parent
,
blnTopMost
);
}
}
#
endregion
#
endregion
...
@@ -316,14 +316,60 @@ namespace HZH_Controls.Forms
...
@@ -316,14 +316,60 @@ namespace HZH_Controls.Forms
Color
?
foreColor
=
null
,
Color
?
foreColor
=
null
,
int
fontSize
=
10
,
int
fontSize
=
10
,
int
autoCloseTime
=
5000
,
int
autoCloseTime
=
5000
,
Form
parentForm
=
null
,
Control
parentControl
=
null
,
bool
blnTopMost
=
true
)
bool
blnTopMost
=
true
)
{
{
FrmAnchorTips
frm
=
new
FrmAnchorTips
(
rectControl
,
strMsg
,
location
,
background
,
foreColor
,
fontSize
,
autoCloseTime
);
FrmAnchorTips
frm
=
new
FrmAnchorTips
(
rectControl
,
strMsg
,
location
,
background
,
foreColor
,
fontSize
,
autoCloseTime
);
frm
.
TopMost
=
blnTopMost
;
frm
.
TopMost
=
blnTopMost
;
frm
.
Show
(
parentForm
);
frm
.
Show
(
parentControl
);
if
(
parentControl
!=
null
)
{
parentControl
.
Disposed
+=
(
a
,
b
)
=>
{
};
parentControl
.
VisibleChanged
+=
(
a
,
b
)
=>
{
try
{
Control
c
=
a
as
Control
;
if
(
CheckControlClose
(
c
))
{
frm
.
Close
();
}
}
catch
(
Exception
ex
)
{
}
};
parentControl
.
ParentChanged
+=
(
a
,
b
)
=>
{
};
parentControl
.
HandleDestroyed
+=
(
a
,
b
)
=>
{
};
}
return
frm
;
return
frm
;
}
}
private
static
bool
CheckControlClose
(
Control
c
)
{
if
(
c
.
IsDisposed
||
!
c
.
Visible
)
return
true
;
else
if
(
c
.
Parent
!=
null
)
return
CheckControlClose
(
c
.
Parent
);
else
{
if
(
c
is
Form
)
return
false
;
else
return
true
;
}
}
#
endregion
#
endregion
#
region
Override
#
region
Override
...
...
HZH_Controls/HZH_Controls/Forms/FrmTips.cs
查看文件 @
b1f7ed3
...
@@ -487,25 +487,10 @@ namespace HZH_Controls.Forms
...
@@ -487,25 +487,10 @@ namespace HZH_Controls.Forms
/// </summary>
/// </summary>
public
enum
TipsState
public
enum
TipsState
{
{
/// <summary>
Default
=
-
12542209
,
/// The default
Success
=
-
9977286
,
/// </summary>
Info
=
-
7299687
,
Default
=
-
1
,
Warning
=
-
693140
,
/// <summary>
/// The success
/// </summary>
Success
=
-
6566849
,
/// <summary>
/// The information
/// </summary>
Info
=
-
12477983
,
/// <summary>
/// The warning
/// </summary>
Warning
=
-
357816
,
/// <summary>
/// The error
/// </summary>
Error
=
-
1097849
Error
=
-
1097849
}
}
}
}
HZH_Controls/HZH_Controls/HZH_Controls.csproj
查看文件 @
b1f7ed3
...
@@ -46,6 +46,12 @@
...
@@ -46,6 +46,12 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile Include="Colors\BasisColors.cs" />
<Compile Include="Colors\ColorEnums.cs" />
<Compile Include="Colors\BorderColors.cs" />
<Compile Include="Colors\ColorExt.cs" />
<Compile Include="Colors\GradientColors.cs" />
<Compile Include="Colors\StatusColors.cs" />
<Compile Include="Controls\Charts\AuxiliaryLable.cs" />
<Compile Include="Controls\Charts\AuxiliaryLable.cs" />
<Compile Include="Controls\Charts\AuxiliaryLine.cs" />
<Compile Include="Controls\Charts\AuxiliaryLine.cs" />
<Compile Include="Controls\Charts\BarChart\BarChartItem.cs" />
<Compile Include="Controls\Charts\BarChart\BarChartItem.cs" />
...
@@ -331,6 +337,9 @@
...
@@ -331,6 +337,9 @@
<SubType>Component</SubType>
<SubType>Component</SubType>
</Compile>
</Compile>
<Compile Include="Helpers\WindowsHook.cs" />
<Compile Include="Helpers\WindowsHook.cs" />
<Compile Include="Colors\LineColors.cs" />
<Compile Include="Colors\TableColors.cs" />
<Compile Include="Colors\TextColors.cs" />
<Compile Include="UIEditor\FrmSelectImage.cs">
<Compile Include="UIEditor\FrmSelectImage.cs">
<SubType>Form</SubType>
<SubType>Form</SubType>
</Compile>
</Compile>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论