Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2ce7c3bc
由
HZH
编写于
2019-09-27 10:24:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改面包屑导航,支持改变颜色
1 个父辈
21728239
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
228 行增加
和
82 行删除
HZH_Controls/HZH_Controls/Controls/Navigation/CrumbNavigationClickEventArgs.cs
HZH_Controls/HZH_Controls/Controls/Navigation/CrumbNavigationItem.cs
HZH_Controls/HZH_Controls/Controls/Navigation/UCCrumbNavigation.cs
HZH_Controls/HZH_Controls/HZH_Controls.csproj
HZH_Controls/Test/UC/UCTestNavigation.Designer.cs
HZH_Controls/Test/UC/UCTestNavigation.cs
HZH_Controls/HZH_Controls/Controls/Navigation/CrumbNavigationClickEventArgs.cs
0 → 100644
查看文件 @
2ce7c3b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
public
class
CrumbNavigationClickEventArgs
:
EventArgs
{
public
int
Index
{
get
;
set
;
}
public
CrumbNavigationItem
Item
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/Navigation/CrumbNavigationItem.cs
0 → 100644
查看文件 @
2ce7c3b
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
public
class
CrumbNavigationItem
{
public
string
Key
{
get
;
set
;
}
public
string
Text
{
get
;
set
;
}
public
Color
?
ItemColor
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/Navigation/UCCrumbNavigation.cs
查看文件 @
2ce7c3b
...
@@ -30,6 +30,7 @@ namespace HZH_Controls.Controls
...
@@ -30,6 +30,7 @@ namespace HZH_Controls.Controls
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
/// <seealso cref="System.Windows.Forms.UserControl" />
[
DefaultEvent
(
"ClickItemed"
)]
public
partial
class
UCCrumbNavigation
:
UserControl
public
partial
class
UCCrumbNavigation
:
UserControl
{
{
/// <summary>
/// <summary>
...
@@ -54,24 +55,20 @@ namespace HZH_Controls.Controls
...
@@ -54,24 +55,20 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The m navigations
/// </summary>
private
string
[]
m_navigations
=
new
string
[]
{
"目录1"
,
"目录2"
,
"目录3"
};
/// <summary>
/// <summary>
/// The m paths
/// The m paths
/// </summary>
/// </summary>
GraphicsPath
[]
m_paths
;
GraphicsPath
[]
m_paths
;
/// <summary>
/// Gets or sets the navigations.
private
CrumbNavigationItem
[]
items
;
/// </summary>
/// <value>The navigations.</value>
public
CrumbNavigationItem
[]
Items
public
string
[]
Navigations
{
{
get
{
return
m_navigation
s
;
}
get
{
return
item
s
;
}
set
set
{
{
m_navigation
s
=
value
;
item
s
=
value
;
if
(
value
==
null
)
if
(
value
==
null
)
m_paths
=
new
GraphicsPath
[
0
];
m_paths
=
new
GraphicsPath
[
0
];
else
else
...
@@ -123,6 +120,9 @@ namespace HZH_Controls.Controls
...
@@ -123,6 +120,9 @@ namespace HZH_Controls.Controls
}
}
}
}
public
delegate
void
CrumbNavigationEventHander
(
object
sender
,
CrumbNavigationClickEventArgs
e
);
public
event
CrumbNavigationEventHander
ClickItemed
;
/// <summary>
/// <summary>
/// Initializes a new instance of the <see cref="UCCrumbNavigation" /> class.
/// Initializes a new instance of the <see cref="UCCrumbNavigation" /> class.
/// </summary>
/// </summary>
...
@@ -136,6 +136,15 @@ namespace HZH_Controls.Controls
...
@@ -136,6 +136,15 @@ namespace HZH_Controls.Controls
this
.
SetStyle
(
ControlStyles
.
SupportsTransparentBackColor
,
true
);
this
.
SetStyle
(
ControlStyles
.
SupportsTransparentBackColor
,
true
);
this
.
SetStyle
(
ControlStyles
.
UserPaint
,
true
);
this
.
SetStyle
(
ControlStyles
.
UserPaint
,
true
);
this
.
MouseDown
+=
UCCrumbNavigation_MouseDown
;
this
.
MouseDown
+=
UCCrumbNavigation_MouseDown
;
Items
=
new
CrumbNavigationItem
[
0
];
if
(
ControlHelper
.
IsDesignMode
())
{
Items
=
new
CrumbNavigationItem
[
3
];
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
Items
[
i
]
=
new
CrumbNavigationItem
()
{
Text
=
"item"
+
(
i
+
1
),
Key
=
i
.
ToString
()
};
}
}
}
}
/// <summary>
/// <summary>
...
@@ -145,15 +154,18 @@ namespace HZH_Controls.Controls
...
@@ -145,15 +154,18 @@ namespace HZH_Controls.Controls
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
void
UCCrumbNavigation_MouseDown
(
object
sender
,
MouseEventArgs
e
)
void
UCCrumbNavigation_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
{
if
(
!
DesignMode
)
if
(
ClickItemed
!=
null
)
{
{
if
(
m_paths
!=
null
&&
m_paths
.
Length
>
0
)
if
(
!
DesignMode
)
{
{
for
(
int
i
=
0
;
i
<
m_paths
.
Length
;
i
++
)
if
(
m_paths
!=
null
&&
m_paths
.
Length
>
0
)
{
{
if
(
m_paths
[
i
].
IsVisible
(
e
.
Location
)
)
for
(
int
i
=
0
;
i
<
m_paths
.
Length
;
i
++
)
{
{
HZH_Controls
.
Forms
.
FrmTips
.
ShowTipsSuccess
(
this
.
FindForm
(),
m_navigations
[
i
]);
if
(
m_paths
[
i
].
IsVisible
(
e
.
Location
))
{
ClickItemed
(
this
,
new
CrumbNavigationClickEventArgs
()
{
Index
=
i
,
Item
=
items
[
i
]
});
}
}
}
}
}
}
}
...
@@ -168,16 +180,16 @@ namespace HZH_Controls.Controls
...
@@ -168,16 +180,16 @@ namespace HZH_Controls.Controls
{
{
base
.
OnPaint
(
e
);
base
.
OnPaint
(
e
);
if
(
m_navigations
!=
null
&&
m_navigation
s
.
Length
>
0
)
if
(
items
!=
null
&&
item
s
.
Length
>
0
)
{
{
var
g
=
e
.
Graphics
;
var
g
=
e
.
Graphics
;
g
.
SetGDIHigh
();
g
.
SetGDIHigh
();
int
intLastX
=
0
;
int
intLastX
=
0
;
int
intLength
=
m_navigation
s
.
Length
;
int
intLength
=
item
s
.
Length
;
for
(
int
i
=
0
;
i
<
m_navigation
s
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
item
s
.
Length
;
i
++)
{
{
GraphicsPath
path
=
new
GraphicsPath
();
GraphicsPath
path
=
new
GraphicsPath
();
string
strText
=
m_navigations
[
i
]
;
string
strText
=
items
[
i
].
Text
;
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
System
.
Drawing
.
SizeF
sizeF
=
g
.
MeasureString
(
strText
.
Replace
(
" "
,
"A"
),
Font
);
int
intTextWidth
=
(
int
)
sizeF
.
Width
+
1
;
int
intTextWidth
=
(
int
)
sizeF
.
Width
+
1
;
path
.
AddLine
(
new
Point
(
intLastX
+
1
,
1
),
new
Point
(
intLastX
+
1
+
(
i
==
0
?
0
:
10
)
+
intTextWidth
,
1
));
path
.
AddLine
(
new
Point
(
intLastX
+
1
,
1
),
new
Point
(
intLastX
+
1
+
(
i
==
0
?
0
:
10
)
+
intTextWidth
,
1
));
...
@@ -203,7 +215,7 @@ namespace HZH_Controls.Controls
...
@@ -203,7 +215,7 @@ namespace HZH_Controls.Controls
{
{
path
.
AddLine
(
new
Point
(
intLastX
+
1
,
this
.
Height
-
1
),
new
Point
(
intLastX
+
1
,
1
));
path
.
AddLine
(
new
Point
(
intLastX
+
1
,
this
.
Height
-
1
),
new
Point
(
intLastX
+
1
,
1
));
}
}
g
.
FillPath
(
new
SolidBrush
(
m_navColor
),
path
);
g
.
FillPath
(
new
SolidBrush
(
(
items
[
i
].
ItemColor
==
null
||
items
[
i
].
ItemColor
==
Color
.
Empty
||
items
[
i
].
ItemColor
==
Color
.
Transparent
)
?
m_navColor
:
items
[
i
].
ItemColor
.
Value
),
path
);
g
.
DrawString
(
strText
,
this
.
Font
,
new
SolidBrush
(
this
.
ForeColor
),
new
PointF
(
intLastX
+
2
+
(
i
==
0
?
0
:
10
),
(
this
.
Height
-
sizeF
.
Height
)
/
2
+
1
));
g
.
DrawString
(
strText
,
this
.
Font
,
new
SolidBrush
(
this
.
ForeColor
),
new
PointF
(
intLastX
+
2
+
(
i
==
0
?
0
:
10
),
(
this
.
Height
-
sizeF
.
Height
)
/
2
+
1
));
m_paths
[
i
]
=
path
;
m_paths
[
i
]
=
path
;
...
...
HZH_Controls/HZH_Controls/HZH_Controls.csproj
查看文件 @
2ce7c3b
...
@@ -70,6 +70,8 @@
...
@@ -70,6 +70,8 @@
<Compile Include="Controls\Charts\RadarChart\UCRadarChart.cs">
<Compile Include="Controls\Charts\RadarChart\UCRadarChart.cs">
<SubType>UserControl</SubType>
<SubType>UserControl</SubType>
</Compile>
</Compile>
<Compile Include="Controls\Navigation\CrumbNavigationClickEventArgs.cs" />
<Compile Include="Controls\Navigation\CrumbNavigationItem.cs" />
<Compile Include="Controls\ScrollBar\ScrollbarComponent.cs">
<Compile Include="Controls\ScrollBar\ScrollbarComponent.cs">
<SubType>Component</SubType>
<SubType>Component</SubType>
</Compile>
</Compile>
...
...
HZH_Controls/Test/UC/UCTestNavigation.Designer.cs
查看文件 @
2ce7c3b
...
@@ -28,83 +28,153 @@
...
@@ -28,83 +28,153 @@
/// </summary>
/// </summary>
private
void
InitializeComponent
()
private
void
InitializeComponent
()
{
{
this
.
ucCrumbNavigation1
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem1
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
this
.
ucCrumbNavigation2
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem2
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
this
.
ucCrumbNavigation3
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem3
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem4
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem5
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem6
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem7
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem8
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem9
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem10
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem11
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem12
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem13
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem14
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem15
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem16
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem17
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
HZH_Controls
.
Controls
.
CrumbNavigationItem
crumbNavigationItem18
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
();
this
.
ucCrumbNavigation4
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
this
.
ucCrumbNavigation4
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
this
.
ucCrumbNavigation3
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
this
.
ucCrumbNavigation2
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
this
.
ucCrumbNavigation1
=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// ucCrumbNavigation1
// ucCrumbNavigation4
//
this
.
ucCrumbNavigation1
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation1
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucCrumbNavigation1
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
35
);
this
.
ucCrumbNavigation1
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
this
.
ucCrumbNavigation1
.
Name
=
"ucCrumbNavigation1"
;
this
.
ucCrumbNavigation1
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
255
)))),
((
int
)(((
byte
)(
77
)))),
((
int
)(((
byte
)(
59
)))));
this
.
ucCrumbNavigation1
.
Navigations
=
new
string
[]
{
"目录1"
,
"目录2"
,
"目录3"
,
"目录4"
};
this
.
ucCrumbNavigation1
.
Size
=
new
System
.
Drawing
.
Size
(
222
,
25
);
this
.
ucCrumbNavigation1
.
TabIndex
=
4
;
//
// ucCrumbNavigation2
//
//
this
.
ucCrumbNavigation2
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation4
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation2
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucCrumbNavigation4
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucCrumbNavigation2
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
96
);
crumbNavigationItem1
.
ItemColor
=
null
;
this
.
ucCrumbNavigation2
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
crumbNavigationItem1
.
Key
=
"0"
;
this
.
ucCrumbNavigation2
.
Name
=
"ucCrumbNavigation2"
;
crumbNavigationItem1
.
Text
=
"item1"
;
this
.
ucCrumbNavigation2
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
16
)))),
((
int
)(((
byte
)(
157
)))),
((
int
)(((
byte
)(
144
)))));
crumbNavigationItem2
.
ItemColor
=
null
;
this
.
ucCrumbNavigation2
.
Navigations
=
new
string
[]
{
crumbNavigationItem2
.
Key
=
"1"
;
"目录1"
,
crumbNavigationItem2
.
Text
=
"item2"
;
"目录2"
,
crumbNavigationItem3
.
ItemColor
=
null
;
"目录3"
,
crumbNavigationItem3
.
Key
=
"2"
;
"目录4"
};
crumbNavigationItem3
.
Text
=
"item3"
;
this
.
ucCrumbNavigation2
.
Size
=
new
System
.
Drawing
.
Size
(
222
,
25
);
crumbNavigationItem4
.
ItemColor
=
null
;
this
.
ucCrumbNavigation2
.
TabIndex
=
4
;
crumbNavigationItem4
.
Key
=
"3"
;
crumbNavigationItem4
.
Text
=
"item4"
;
crumbNavigationItem5
.
ItemColor
=
null
;
crumbNavigationItem5
.
Key
=
"4"
;
crumbNavigationItem5
.
Text
=
"item5"
;
crumbNavigationItem6
.
ItemColor
=
null
;
crumbNavigationItem6
.
Key
=
"5"
;
crumbNavigationItem6
.
Text
=
"item6"
;
this
.
ucCrumbNavigation4
.
Items
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
[]
{
crumbNavigationItem1
,
crumbNavigationItem2
,
crumbNavigationItem3
,
crumbNavigationItem4
,
crumbNavigationItem5
,
crumbNavigationItem6
};
this
.
ucCrumbNavigation4
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
210
);
this
.
ucCrumbNavigation4
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
this
.
ucCrumbNavigation4
.
Name
=
"ucCrumbNavigation4"
;
this
.
ucCrumbNavigation4
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
16
)))),
((
int
)(((
byte
)(
157
)))),
((
int
)(((
byte
)(
144
)))));
this
.
ucCrumbNavigation4
.
Size
=
new
System
.
Drawing
.
Size
(
523
,
25
);
this
.
ucCrumbNavigation4
.
TabIndex
=
4
;
this
.
ucCrumbNavigation4
.
ClickItemed
+=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
.
CrumbNavigationEventHander
(
this
.
ucCrumbNavigation4_ClickItemed
);
//
//
// ucCrumbNavigation3
// ucCrumbNavigation3
//
//
this
.
ucCrumbNavigation3
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation3
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation3
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucCrumbNavigation3
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
crumbNavigationItem7
.
ItemColor
=
null
;
crumbNavigationItem7
.
Key
=
"0"
;
crumbNavigationItem7
.
Text
=
"item1"
;
crumbNavigationItem8
.
ItemColor
=
null
;
crumbNavigationItem8
.
Key
=
"1"
;
crumbNavigationItem8
.
Text
=
"item2"
;
crumbNavigationItem9
.
ItemColor
=
null
;
crumbNavigationItem9
.
Key
=
"2"
;
crumbNavigationItem9
.
Text
=
"item3"
;
crumbNavigationItem10
.
ItemColor
=
null
;
crumbNavigationItem10
.
Key
=
"3"
;
crumbNavigationItem10
.
Text
=
"item4"
;
crumbNavigationItem11
.
ItemColor
=
null
;
crumbNavigationItem11
.
Key
=
"4"
;
crumbNavigationItem11
.
Text
=
"item5"
;
crumbNavigationItem12
.
ItemColor
=
null
;
crumbNavigationItem12
.
Key
=
"5"
;
crumbNavigationItem12
.
Text
=
"item6"
;
this
.
ucCrumbNavigation3
.
Items
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
[]
{
crumbNavigationItem7
,
crumbNavigationItem8
,
crumbNavigationItem9
,
crumbNavigationItem10
,
crumbNavigationItem11
,
crumbNavigationItem12
};
this
.
ucCrumbNavigation3
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
156
);
this
.
ucCrumbNavigation3
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
156
);
this
.
ucCrumbNavigation3
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
this
.
ucCrumbNavigation3
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
this
.
ucCrumbNavigation3
.
Name
=
"ucCrumbNavigation3"
;
this
.
ucCrumbNavigation3
.
Name
=
"ucCrumbNavigation3"
;
this
.
ucCrumbNavigation3
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
255
)))),
((
int
)(((
byte
)(
77
)))),
((
int
)(((
byte
)(
59
)))));
this
.
ucCrumbNavigation3
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
255
)))),
((
int
)(((
byte
)(
77
)))),
((
int
)(((
byte
)(
59
)))));
this
.
ucCrumbNavigation3
.
Navigations
=
new
string
[]
{
"目录1"
,
"目录2"
,
"目录3"
,
"目录4"
,
"目录5"
,
"目录6"
,
"目录7"
,
"目录8"
};
this
.
ucCrumbNavigation3
.
Size
=
new
System
.
Drawing
.
Size
(
523
,
25
);
this
.
ucCrumbNavigation3
.
Size
=
new
System
.
Drawing
.
Size
(
523
,
25
);
this
.
ucCrumbNavigation3
.
TabIndex
=
4
;
this
.
ucCrumbNavigation3
.
TabIndex
=
4
;
this
.
ucCrumbNavigation3
.
ClickItemed
+=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
.
CrumbNavigationEventHander
(
this
.
ucCrumbNavigation3_ClickItemed
);
//
//
// ucCrumbNavigation
4
// ucCrumbNavigation
2
//
//
this
.
ucCrumbNavigation4
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation2
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation4
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucCrumbNavigation2
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
ucCrumbNavigation4
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
210
);
crumbNavigationItem13
.
ItemColor
=
null
;
this
.
ucCrumbNavigation4
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
crumbNavigationItem13
.
Key
=
"0"
;
this
.
ucCrumbNavigation4
.
Name
=
"ucCrumbNavigation4"
;
crumbNavigationItem13
.
Text
=
"item1"
;
this
.
ucCrumbNavigation4
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
16
)))),
((
int
)(((
byte
)(
157
)))),
((
int
)(((
byte
)(
144
)))));
crumbNavigationItem14
.
ItemColor
=
null
;
this
.
ucCrumbNavigation4
.
Navigations
=
new
string
[]
{
crumbNavigationItem14
.
Key
=
"1"
;
"目录1"
,
crumbNavigationItem14
.
Text
=
"item2"
;
"目录2"
,
crumbNavigationItem15
.
ItemColor
=
null
;
"目录3"
,
crumbNavigationItem15
.
Key
=
"2"
;
"目录4"
,
crumbNavigationItem15
.
Text
=
"item3"
;
"目录5"
,
this
.
ucCrumbNavigation2
.
Items
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
[]
{
"目录6"
,
crumbNavigationItem13
,
"目录7"
,
crumbNavigationItem14
,
"目录8"
};
crumbNavigationItem15
};
this
.
ucCrumbNavigation4
.
Size
=
new
System
.
Drawing
.
Size
(
523
,
25
);
this
.
ucCrumbNavigation2
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
96
);
this
.
ucCrumbNavigation4
.
TabIndex
=
4
;
this
.
ucCrumbNavigation2
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
this
.
ucCrumbNavigation2
.
Name
=
"ucCrumbNavigation2"
;
this
.
ucCrumbNavigation2
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
16
)))),
((
int
)(((
byte
)(
157
)))),
((
int
)(((
byte
)(
144
)))));
this
.
ucCrumbNavigation2
.
Size
=
new
System
.
Drawing
.
Size
(
222
,
25
);
this
.
ucCrumbNavigation2
.
TabIndex
=
4
;
this
.
ucCrumbNavigation2
.
ClickItemed
+=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
.
CrumbNavigationEventHander
(
this
.
ucCrumbNavigation2_ClickItemed
);
//
// ucCrumbNavigation1
//
this
.
ucCrumbNavigation1
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Hand
;
this
.
ucCrumbNavigation1
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
crumbNavigationItem16
.
ItemColor
=
null
;
crumbNavigationItem16
.
Key
=
"0"
;
crumbNavigationItem16
.
Text
=
"item1"
;
crumbNavigationItem17
.
ItemColor
=
null
;
crumbNavigationItem17
.
Key
=
"1"
;
crumbNavigationItem17
.
Text
=
"item2"
;
crumbNavigationItem18
.
ItemColor
=
null
;
crumbNavigationItem18
.
Key
=
"2"
;
crumbNavigationItem18
.
Text
=
"item3"
;
this
.
ucCrumbNavigation1
.
Items
=
new
HZH_Controls
.
Controls
.
CrumbNavigationItem
[]
{
crumbNavigationItem16
,
crumbNavigationItem17
,
crumbNavigationItem18
};
this
.
ucCrumbNavigation1
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
35
);
this
.
ucCrumbNavigation1
.
MinimumSize
=
new
System
.
Drawing
.
Size
(
0
,
25
);
this
.
ucCrumbNavigation1
.
Name
=
"ucCrumbNavigation1"
;
this
.
ucCrumbNavigation1
.
NavColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
255
)))),
((
int
)(((
byte
)(
77
)))),
((
int
)(((
byte
)(
59
)))));
this
.
ucCrumbNavigation1
.
Size
=
new
System
.
Drawing
.
Size
(
222
,
25
);
this
.
ucCrumbNavigation1
.
TabIndex
=
4
;
this
.
ucCrumbNavigation1
.
ClickItemed
+=
new
HZH_Controls
.
Controls
.
UCCrumbNavigation
.
CrumbNavigationEventHander
(
this
.
ucCrumbNavigation1_ClickItemed
);
//
//
// UCTestNavigation
// UCTestNavigation
//
//
...
...
HZH_Controls/Test/UC/UCTestNavigation.cs
查看文件 @
2ce7c3b
...
@@ -16,5 +16,39 @@ namespace Test.UC
...
@@ -16,5 +16,39 @@ namespace Test.UC
{
{
InitializeComponent
();
InitializeComponent
();
}
}
private
void
ucCrumbNavigation3_ClickItemed
(
object
sender
,
HZH_Controls
.
Controls
.
CrumbNavigationClickEventArgs
e
)
{
for
(
int
i
=
0
;
i
<
ucCrumbNavigation3
.
Items
.
Length
;
i
++)
{
if
(
i
>
e
.
Index
)
ucCrumbNavigation3
.
Items
[
i
].
ItemColor
=
Color
.
Gray
;
else
ucCrumbNavigation3
.
Items
[
i
].
ItemColor
=
null
;
}
ucCrumbNavigation3
.
Invalidate
();
}
private
void
ucCrumbNavigation4_ClickItemed
(
object
sender
,
HZH_Controls
.
Controls
.
CrumbNavigationClickEventArgs
e
)
{
for
(
int
i
=
0
;
i
<
ucCrumbNavigation4
.
Items
.
Length
;
i
++)
{
if
(
i
>
e
.
Index
)
ucCrumbNavigation4
.
Items
[
i
].
ItemColor
=
Color
.
Gray
;
else
ucCrumbNavigation4
.
Items
[
i
].
ItemColor
=
null
;
}
ucCrumbNavigation4
.
Invalidate
();
}
private
void
ucCrumbNavigation1_ClickItemed
(
object
sender
,
HZH_Controls
.
Controls
.
CrumbNavigationClickEventArgs
e
)
{
HZH_Controls
.
Forms
.
FrmTips
.
ShowTipsSuccess
(
this
.
FindForm
(),
e
.
Item
.
Text
);
}
private
void
ucCrumbNavigation2_ClickItemed
(
object
sender
,
HZH_Controls
.
Controls
.
CrumbNavigationClickEventArgs
e
)
{
HZH_Controls
.
Forms
.
FrmTips
.
ShowTipsSuccess
(
this
.
FindForm
(),
e
.
Item
.
Text
);
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论