Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 20664192
由
HZH
编写于
2019-10-11 10:54:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
自定义导航菜单弹出项
1 个父辈
a1549324
全部展开
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
819 行增加
和
99 行删除
HZH_Controls/HZH_Controls/Controls/NavigationMenu/NavigationMenuItem.cs
HZH_Controls/HZH_Controls/Controls/NavigationMenu/NavigationMenuItemBase.cs
HZH_Controls/HZH_Controls/Controls/NavigationMenu/NavigationMenuItemExt.cs
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuExt.Designer.cs
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuExt.cs
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuExt.resx
HZH_Controls/HZH_Controls/HZH_Controls.csproj
HZH_Controls/Test/FrmMain.cs
HZH_Controls/Test/Test.csproj
HZH_Controls/Test/UC/UCTestNavigationMenuExt.Designer.cs
HZH_Controls/Test/UC/UCTestNavigationMenuExt.cs
HZH_Controls/Test/UC/UCTestNavigationMenuExt.resx
HZH_Controls/HZH_Controls/Controls/NavigationMenu/NavigationMenuItem.cs
查看文件 @
2066419
...
...
@@ -25,69 +25,9 @@ namespace HZH_Controls.Controls
/// <summary>
/// Class NavigationMenuItem.
/// </summary>
public
class
NavigationMenuItem
public
class
NavigationMenuItem
:
NavigationMenuItemBase
{
/// <summary>
/// The icon
/// </summary>
private
Image
icon
;
/// <summary>
/// Gets or sets the icon.
/// </summary>
/// <value>The icon.</value>
[
Description
(
"图标,仅顶级节点有效"
)]
public
Image
Icon
{
get
{
return
icon
;
}
set
{
icon
=
value
;
}
}
/// <summary>
/// The text
/// </summary>
private
string
text
;
/// <summary>
/// Gets or sets the text.
/// </summary>
/// <value>The text.</value>
[
Description
(
"文本"
)]
public
string
Text
{
get
{
return
text
;
}
set
{
text
=
value
;
}
}
/// <summary>
/// The show tip
/// </summary>
private
bool
showTip
;
/// <summary>
/// Gets or sets a value indicating whether [show tip].当TipText为空时只显示一个小圆点,否则显示TipText文字
/// </summary>
/// <value><c>true</c> if [show tip]; otherwise, <c>false</c>.</value>
[
Description
(
"是否显示角标,仅顶级节点有效"
)]
public
bool
ShowTip
{
get
{
return
showTip
;
}
set
{
showTip
=
value
;
}
}
/// <summary>
/// The tip text
/// </summary>
private
string
tipText
;
/// <summary>
/// Gets or sets the tip text
/// </summary>
/// <value>The tip text.</value>
[
Description
(
"角标文字,仅顶级节点有效"
)]
public
string
TipText
{
get
{
return
tipText
;
}
set
{
tipText
=
value
;
}
}
/// <summary>
/// The items
/// </summary>
private
NavigationMenuItem
[]
items
;
...
...
@@ -113,44 +53,6 @@ namespace HZH_Controls.Controls
}
/// <summary>
/// The anchor right
/// </summary>
private
bool
anchorRight
;
/// <summary>
/// Gets or sets a value indicating whether [anchor right].
/// </summary>
/// <value><c>true</c> if [anchor right]; otherwise, <c>false</c>.</value>
[
Description
(
"是否靠右对齐"
)]
public
bool
AnchorRight
{
get
{
return
anchorRight
;
}
set
{
anchorRight
=
value
;
}
}
/// <summary>
/// The item width
/// </summary>
private
int
itemWidth
=
100
;
/// <summary>
/// Gets or sets the width of the item.
/// </summary>
/// <value>The width of the item.</value>
[
Description
(
"宽度"
)]
public
int
ItemWidth
{
get
{
return
itemWidth
;
}
set
{
itemWidth
=
value
;
}
}
/// <summary>
/// Gets or sets the data source.
/// </summary>
/// <value>The data source.</value>
[
Description
(
"数据源"
)]
public
object
DataSource
{
get
;
set
;
}
/// <summary>
/// Gets or sets a value indicating whether this instance has split lint at top.
/// </summary>
/// <value><c>true</c> if this instance has split lint at top; otherwise, <c>false</c>.</value>
...
...
HZH_Controls/HZH_Controls/Controls/NavigationMenu/NavigationMenuItemBase.cs
0 → 100644
查看文件 @
2066419
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
public
class
NavigationMenuItemBase
{
/// <summary>
/// The icon
/// </summary>
private
Image
icon
;
/// <summary>
/// Gets or sets the icon.
/// </summary>
/// <value>The icon.</value>
[
Description
(
"图标,仅顶级节点有效"
)]
public
Image
Icon
{
get
{
return
icon
;
}
set
{
icon
=
value
;
}
}
/// <summary>
/// The text
/// </summary>
private
string
text
;
/// <summary>
/// Gets or sets the text.
/// </summary>
/// <value>The text.</value>
[
Description
(
"文本"
)]
public
string
Text
{
get
{
return
text
;
}
set
{
text
=
value
;
}
}
/// <summary>
/// The show tip
/// </summary>
private
bool
showTip
;
/// <summary>
/// Gets or sets a value indicating whether [show tip].当TipText为空时只显示一个小圆点,否则显示TipText文字
/// </summary>
/// <value><c>true</c> if [show tip]; otherwise, <c>false</c>.</value>
[
Description
(
"是否显示角标,仅顶级节点有效"
)]
public
bool
ShowTip
{
get
{
return
showTip
;
}
set
{
showTip
=
value
;
}
}
/// <summary>
/// The tip text
/// </summary>
private
string
tipText
;
/// <summary>
/// Gets or sets the tip text
/// </summary>
/// <value>The tip text.</value>
[
Description
(
"角标文字,仅顶级节点有效"
)]
public
string
TipText
{
get
{
return
tipText
;
}
set
{
tipText
=
value
;
}
}
/// <summary>
/// The anchor right
/// </summary>
private
bool
anchorRight
;
/// <summary>
/// Gets or sets a value indicating whether [anchor right].
/// </summary>
/// <value><c>true</c> if [anchor right]; otherwise, <c>false</c>.</value>
[
Description
(
"是否靠右对齐"
)]
public
bool
AnchorRight
{
get
{
return
anchorRight
;
}
set
{
anchorRight
=
value
;
}
}
/// <summary>
/// The item width
/// </summary>
private
int
itemWidth
=
100
;
/// <summary>
/// Gets or sets the width of the item.
/// </summary>
/// <value>The width of the item.</value>
[
Description
(
"宽度"
)]
public
int
ItemWidth
{
get
{
return
itemWidth
;
}
set
{
itemWidth
=
value
;
}
}
/// <summary>
/// Gets or sets the data source.
/// </summary>
/// <value>The data source.</value>
[
Description
(
"数据源"
)]
public
object
DataSource
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/NavigationMenu/NavigationMenuItemExt.cs
0 → 100644
查看文件 @
2066419
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
public
class
NavigationMenuItemExt
:
NavigationMenuItemBase
{
public
System
.
Windows
.
Forms
.
Control
ShowControl
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuExt.Designer.cs
0 → 100644
查看文件 @
2066419
namespace
HZH_Controls.Controls
{
partial
class
UCNavigationMenuExt
{
/// <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
();
//
// UCNavigationMenuExt
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
57
)))),
((
int
)(((
byte
)(
61
)))),
((
int
)(((
byte
)(
73
)))));
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
11F
);
this
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
224
)))),
((
int
)(((
byte
)(
224
)))),
((
int
)(((
byte
)(
224
)))));
this
.
Name
=
"UCNavigationMenuExt"
;
this
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
20
,
0
,
0
,
0
);
this
.
Size
=
new
System
.
Drawing
.
Size
(
529
,
60
);
this
.
ResumeLayout
(
false
);
}
#
endregion
}
}
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuExt.cs
0 → 100644
查看文件 @
2066419
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Data
;
using
System.Linq
;
using
System.Text
;
using
System.Windows.Forms
;
using
HZH_Controls.Forms
;
namespace
HZH_Controls.Controls
{
public
partial
class
UCNavigationMenuExt
:
UserControl
{
/// <summary>
/// Occurs when [click itemed].
/// </summary>
[
Description
(
"点击节点事件"
),
Category
(
"自定义"
)]
public
event
EventHandler
ClickItemed
;
/// <summary>
/// The select item
/// </summary>
private
NavigationMenuItemExt
selectItem
=
null
;
/// <summary>
/// Gets the select item.
/// </summary>
/// <value>The select item.</value>
[
Description
(
"选中的节点"
),
Category
(
"自定义"
)]
public
NavigationMenuItemExt
SelectItem
{
get
{
return
selectItem
;
}
private
set
{
selectItem
=
value
;
}
}
/// <summary>
/// The items
/// </summary>
NavigationMenuItemExt
[]
items
;
/// <summary>
/// Gets or sets the items.
/// </summary>
/// <value>The items.</value>
[
Description
(
"节点列表"
),
Category
(
"自定义"
)]
public
NavigationMenuItemExt
[]
Items
{
get
{
return
items
;
}
set
{
items
=
value
;
ReloadMenu
();
}
}
/// <summary>
/// The tip color
/// </summary>
private
Color
tipColor
=
Color
.
FromArgb
(
255
,
87
,
34
);
/// <summary>
/// Gets or sets the color of the tip.
/// </summary>
/// <value>The color of the tip.</value>
[
Description
(
"角标颜色"
),
Category
(
"自定义"
)]
public
Color
TipColor
{
get
{
return
tipColor
;
}
set
{
tipColor
=
value
;
}
}
/// <summary>
/// 获取或设置控件的前景色。
/// </summary>
/// <value>The color of the fore.</value>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
public
override
System
.
Drawing
.
Color
ForeColor
{
get
{
return
base
.
ForeColor
;
}
set
{
base
.
ForeColor
=
value
;
foreach
(
Control
c
in
this
.
Controls
)
{
c
.
ForeColor
=
value
;
}
}
}
/// <summary>
/// 获取或设置控件显示的文字的字体。
/// </summary>
/// <value>The font.</value>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
public
override
Font
Font
{
get
{
return
base
.
Font
;
}
set
{
base
.
Font
=
value
;
foreach
(
Control
c
in
this
.
Controls
)
{
c
.
Font
=
value
;
}
}
}
/// <summary>
/// The m LST anchors
/// </summary>
Dictionary
<
NavigationMenuItemExt
,
FrmAnchor
>
m_lstAnchors
=
new
Dictionary
<
NavigationMenuItemExt
,
FrmAnchor
>();
public
UCNavigationMenuExt
()
{
InitializeComponent
();
items
=
new
NavigationMenuItemExt
[
0
];
if
(
ControlHelper
.
IsDesignMode
())
{
items
=
new
NavigationMenuItemExt
[
4
];
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
items
[
i
]
=
new
NavigationMenuItemExt
()
{
Text
=
"菜单"
+
(
i
+
1
),
AnchorRight
=
i
>=
2
};
}
}
}
private
void
ReloadMenu
()
{
try
{
ControlHelper
.
FreezeControl
(
this
,
true
);
this
.
Controls
.
Clear
();
if
(
items
!=
null
&&
items
.
Length
>
0
)
{
foreach
(
var
item
in
items
)
{
var
menu
=
(
NavigationMenuItemExt
)
item
;
Label
lbl
=
new
Label
();
lbl
.
AutoSize
=
false
;
lbl
.
TextAlign
=
ContentAlignment
.
MiddleCenter
;
lbl
.
Width
=
menu
.
ItemWidth
;
lbl
.
Text
=
menu
.
Text
;
lbl
.
Font
=
Font
;
lbl
.
ForeColor
=
ForeColor
;
lbl
.
Paint
+=
lbl_Paint
;
lbl
.
MouseEnter
+=
lbl_MouseEnter
;
lbl
.
Tag
=
menu
;
lbl
.
Click
+=
lbl_Click
;
if
(
menu
.
AnchorRight
)
{
lbl
.
Dock
=
DockStyle
.
Right
;
}
else
{
lbl
.
Dock
=
DockStyle
.
Left
;
}
this
.
Controls
.
Add
(
lbl
);
lbl
.
BringToFront
();
}
}
}
finally
{
ControlHelper
.
FreezeControl
(
this
,
false
);
}
}
void
lbl_Click
(
object
sender
,
EventArgs
e
)
{
Label
lbl
=
sender
as
Label
;
if
(
lbl
.
Tag
!=
null
)
{
var
menu
=
(
NavigationMenuItemExt
)
lbl
.
Tag
;
if
(
menu
.
ShowControl
==
null
)
{
selectItem
=
menu
;
while
(
m_lstAnchors
.
Count
>
0
)
{
try
{
foreach
(
var
item
in
m_lstAnchors
)
{
item
.
Value
.
Hide
();
}
}
catch
{
}
}
if
(
ClickItemed
!=
null
)
{
ClickItemed
(
this
,
e
);
}
}
}
}
/// <summary>
/// Handles the MouseEnter event of the lbl control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
void
lbl_MouseEnter
(
object
sender
,
EventArgs
e
)
{
Label
lbl
=
sender
as
Label
;
var
menu
=
lbl
.
Tag
as
NavigationMenuItemExt
;
foreach
(
var
item
in
m_lstAnchors
)
{
m_lstAnchors
[
item
.
Key
].
Hide
();
}
if
(
menu
.
ShowControl
!=
null
)
{
if
(!
m_lstAnchors
.
ContainsKey
(
menu
))
{
m_lstAnchors
[
menu
]
=
new
FrmAnchor
(
lbl
,
menu
.
ShowControl
);
}
m_lstAnchors
[
menu
].
Show
();
m_lstAnchors
[
menu
].
Size
=
menu
.
ShowControl
.
Size
;
}
}
/// <summary>
/// Handles the Paint event of the lbl control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="PaintEventArgs"/> instance containing the event data.</param>
void
lbl_Paint
(
object
sender
,
PaintEventArgs
e
)
{
Label
lbl
=
sender
as
Label
;
if
(
lbl
.
Tag
!=
null
)
{
var
menu
=
(
NavigationMenuItemExt
)
lbl
.
Tag
;
e
.
Graphics
.
SetGDIHigh
();
if
(
menu
.
ShowTip
)
{
if
(!
string
.
IsNullOrEmpty
(
menu
.
TipText
))
{
var
rect
=
new
Rectangle
(
lbl
.
Width
-
25
,
lbl
.
Height
/
2
-
10
,
20
,
20
);
var
path
=
rect
.
CreateRoundedRectanglePath
(
5
);
e
.
Graphics
.
FillPath
(
new
SolidBrush
(
tipColor
),
path
);
e
.
Graphics
.
DrawString
(
menu
.
TipText
,
new
Font
(
"微软雅黑"
,
8f
),
new
SolidBrush
(
Color
.
White
),
rect
,
new
StringFormat
()
{
Alignment
=
StringAlignment
.
Center
,
LineAlignment
=
StringAlignment
.
Center
});
}
else
{
e
.
Graphics
.
FillEllipse
(
new
SolidBrush
(
tipColor
),
new
Rectangle
(
lbl
.
Width
-
20
,
lbl
.
Height
/
2
-
10
,
10
,
10
));
}
}
if
(
menu
.
Icon
!=
null
)
{
e
.
Graphics
.
DrawImage
(
menu
.
Icon
,
new
Rectangle
(
1
,
(
lbl
.
Height
-
25
)
/
2
,
25
,
25
),
0
,
0
,
menu
.
Icon
.
Width
,
menu
.
Icon
.
Height
,
GraphicsUnit
.
Pixel
);
}
}
}
}
}
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuExt.resx
0 → 100644
查看文件 @
2066419
<?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>
</root>
\ No newline at end of file
HZH_Controls/HZH_Controls/HZH_Controls.csproj
查看文件 @
2066419
...
...
@@ -83,12 +83,20 @@
<DependentUpon>GraphicalOverlayComponent.cs</DependentUpon>
</Compile>
<Compile Include="Controls\NavigationMenu\NavigationMenuItem.cs" />
<Compile Include="Controls\NavigationMenu\NavigationMenuItemBase.cs" />
<Compile Include="Controls\NavigationMenu\NavigationMenuItemExt.cs" />
<Compile Include="Controls\NavigationMenu\UCNavigationMenu.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\NavigationMenu\UCNavigationMenu.Designer.cs">
<DependentUpon>UCNavigationMenu.cs</DependentUpon>
</Compile>
<Compile Include="Controls\NavigationMenu\UCNavigationMenuExt.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\NavigationMenu\UCNavigationMenuExt.Designer.cs">
<DependentUpon>UCNavigationMenuExt.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Navigation\CrumbNavigationClickEventArgs.cs" />
<Compile Include="Controls\Navigation\CrumbNavigationItem.cs" />
<Compile Include="Controls\Sampling\UCSampling.cs">
...
...
@@ -721,6 +729,9 @@
<EmbeddedResource Include="Controls\NavigationMenu\UCNavigationMenu.resx">
<DependentUpon>UCNavigationMenu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\NavigationMenu\UCNavigationMenuExt.resx">
<DependentUpon>UCNavigationMenuExt.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Navigation\UCCrumbNavigation.resx">
<DependentUpon>UCCrumbNavigation.cs</DependentUpon>
</EmbeddedResource>
...
...
HZH_Controls/Test/FrmMain.cs
查看文件 @
2066419
...
...
@@ -65,6 +65,7 @@ namespace Test
tnControl
.
Nodes
.
Add
(
"倒影"
);
tnControl
.
Nodes
.
Add
(
"内置颜色"
);
tnControl
.
Nodes
.
Add
(
"导航菜单"
);
tnControl
.
Nodes
.
Add
(
"扩展导航菜单"
);
tnControl
.
Nodes
.
Add
(
"分割线标签"
);
tnControl
.
Nodes
.
Add
(
"时间轴"
);
tnControl
.
Nodes
.
Add
(
"穿梭框"
);
...
...
@@ -270,6 +271,9 @@ namespace Test
case
"导航菜单"
:
AddControl
(
new
UC
.
UCTestNavigationMenu
());
break
;
case
"扩展导航菜单"
:
AddControl
(
new
UC
.
UCTestNavigationMenuExt
());
break
;
case
"分割线标签"
:
AddControl
(
new
UC
.
UCTestSplitLabel
());
break
;
...
...
HZH_Controls/Test/Test.csproj
查看文件 @
2066419
...
...
@@ -218,6 +218,12 @@
<Compile Include="UC\UCTestNavigationMenu.Designer.cs">
<DependentUpon>UCTestNavigationMenu.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestNavigationMenuExt.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestNavigationMenuExt.Designer.cs">
<DependentUpon>UCTestNavigationMenuExt.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestPage.cs">
<SubType>UserControl</SubType>
</Compile>
...
...
@@ -455,6 +461,9 @@
<EmbeddedResource Include="UC\UCTestNavigationMenu.resx">
<DependentUpon>UCTestNavigationMenu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestNavigationMenuExt.resx">
<DependentUpon>UCTestNavigationMenuExt.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestPage.resx">
<DependentUpon>UCTestPage.cs</DependentUpon>
</EmbeddedResource>
...
...
HZH_Controls/Test/UC/UCTestNavigationMenuExt.Designer.cs
0 → 100644
查看文件 @
2066419
此文件的差异被折叠,
点击展开。
HZH_Controls/Test/UC/UCTestNavigationMenuExt.cs
0 → 100644
查看文件 @
2066419
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Data
;
using
System.Linq
;
using
System.Text
;
using
System.Windows.Forms
;
using
HZH_Controls.Controls
;
namespace
Test.UC
{
public
partial
class
UCTestNavigationMenuExt
:
UserControl
{
public
UCTestNavigationMenuExt
()
{
InitializeComponent
();
}
private
void
UCTestNavigationMenuExt_Load
(
object
sender
,
EventArgs
e
)
{
foreach
(
var
item
in
this
.
ucNavigationMenuExt1
.
Items
)
{
Control
panel1
=
CreatePanel
(
this
.
ucNavigationMenuExt1
.
BackColor
);
item
.
ShowControl
=
panel1
;
}
foreach
(
var
item
in
this
.
ucNavigationMenuExt2
.
Items
)
{
Control
panel2
=
CreatePanel
(
this
.
ucNavigationMenuExt2
.
BackColor
);
item
.
ShowControl
=
panel2
;
}
foreach
(
var
item
in
this
.
ucNavigationMenuExt3
.
Items
)
{
Control
panel3
=
CreatePanel
(
this
.
ucNavigationMenuExt3
.
BackColor
);
item
.
ShowControl
=
panel3
;
}
foreach
(
var
item
in
this
.
ucNavigationMenuExt4
.
Items
)
{
Control
panel4
=
CreatePanel
(
this
.
ucNavigationMenuExt4
.
BackColor
);
item
.
ShowControl
=
panel4
;
}
}
private
Control
CreatePanel
(
Color
color
)
{
UCControlBase
c
=
new
UCControlBase
();
c
.
IsRadius
=
true
;
c
.
ConerRadius
=
5
;
c
.
IsShowRect
=
true
;
c
.
FillColor
=
color
;
c
.
BackColor
=
Color
.
Transparent
;
c
.
Size
=
new
Size
(
130
,
180
);
Label
lbl
=
new
Label
();
lbl
.
AutoSize
=
false
;
lbl
.
Dock
=
DockStyle
.
Fill
;
lbl
.
TextAlign
=
ContentAlignment
.
MiddleCenter
;
lbl
.
Text
=
"这是一个自定义的弹出内容,你可以根据自己需求进行扩展\r\n"
+
Guid
.
NewGuid
().
ToString
();
lbl
.
ForeColor
=
Color
.
White
;
c
.
Controls
.
Add
(
lbl
);
return
c
;
}
}
}
HZH_Controls/Test/UC/UCTestNavigationMenuExt.resx
0 → 100644
查看文件 @
2066419
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="navigationMenuItemExt1.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAEGSURBVDhP7ZGxagJBFEX3A9JYBjtLgx9gIYRAsLKK/kSqFIKCyKbMD1jYpE8nyZJA2NmdnW0C
FpI/MKS3t8t58kxlsbOL3R64zHt35l12Z4Kakzjn2mmaXmhbHWPMo7X2B/XUqoYEivjKX0LnaheHoRHD
T9r+B6Im/it64xoudbsYSZIsGLQScgwUH2/I3jdreDjoA4N3DO6OgfRL+i31jR7xJ4qiBiGf6IureFa7
PAQN0UpE4FJtf/i9KwJeCBqjkPqedcLq8jxv6bFiMHjNoInjuKt9iB6k5nX71Gv2B9KXQgOnhPRYP9CG
+la3/ZFAeWVC9tQztcsjgeg9y7KOWjVnIwj+AISOvF76iy4mAAAAAElFTkSuQmCC
</value>
</data>
<data name="navigationMenuItemExt5.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAEGSURBVDhP7ZGxagJBFEX3A9JYBjtLgx9gIYRAsLKK/kSqFIKCyKbMD1jYpE8nyZJA2NmdnW0C
FpI/MKS3t8t58kxlsbOL3R64zHt35l12Z4Kakzjn2mmaXmhbHWPMo7X2B/XUqoYEivjKX0LnaheHoRHD
T9r+B6Im/it64xoudbsYSZIsGLQScgwUH2/I3jdreDjoA4N3DO6OgfRL+i31jR7xJ4qiBiGf6IureFa7
PAQN0UpE4FJtf/i9KwJeCBqjkPqedcLq8jxv6bFiMHjNoInjuKt9iB6k5nX71Gv2B9KXQgOnhPRYP9CG
+la3/ZFAeWVC9tQztcsjgeg9y7KOWjVnIwj+AISOvF76iy4mAAAAAElFTkSuQmCC
</value>
</data>
<data name="navigationMenuItemExt9.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAEGSURBVDhP7ZGxagJBFEX3A9JYBjtLgx9gIYRAsLKK/kSqFIKCyKbMD1jYpE8nyZJA2NmdnW0C
FpI/MKS3t8t58kxlsbOL3R64zHt35l12Z4Kakzjn2mmaXmhbHWPMo7X2B/XUqoYEivjKX0LnaheHoRHD
T9r+B6Im/it64xoudbsYSZIsGLQScgwUH2/I3jdreDjoA4N3DO6OgfRL+i31jR7xJ4qiBiGf6IureFa7
PAQN0UpE4FJtf/i9KwJeCBqjkPqedcLq8jxv6bFiMHjNoInjuKt9iB6k5nX71Gv2B9KXQgOnhPRYP9CG
+la3/ZFAeWVC9tQztcsjgeg9y7KOWjVnIwj+AISOvF76iy4mAAAAAElFTkSuQmCC
</value>
</data>
<data name="navigationMenuItemExt13.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAEGSURBVDhP7ZGxagJBFEX3A9JYBjtLgx9gIYRAsLKK/kSqFIKCyKbMD1jYpE8nyZJA2NmdnW0C
FpI/MKS3t8t58kxlsbOL3R64zHt35l12Z4Kakzjn2mmaXmhbHWPMo7X2B/XUqoYEivjKX0LnaheHoRHD
T9r+B6Im/it64xoudbsYSZIsGLQScgwUH2/I3jdreDjoA4N3DO6OgfRL+i31jR7xJ4qiBiGf6IureFa7
PAQN0UpE4FJtf/i9KwJeCBqjkPqedcLq8jxv6bFiMHjNoInjuKt9iB6k5nX71Gv2B9KXQgOnhPRYP9CG
+la3/ZFAeWVC9tQztcsjgeg9y7KOWjVnIwj+AISOvF76iy4mAAAAAElFTkSuQmCC
</value>
</data>
</root>
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论