Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 017189bd
由
HZH
编写于
2019-08-15 10:38:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加导航控件
1 个父辈
36d6f140
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
1100 行增加
和
0 行删除
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
HZH_Controls/HZH_Controls/Controls/Menu/IMenuItem.cs
HZH_Controls/HZH_Controls/Controls/Menu/MenuItemEntity.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenu.Designer.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenu.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenu.resx
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuChildrenItem.Designer.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuChildrenItem.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuChildrenItem.resx
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuParentItem.Designer.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuParentItem.cs
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuParentItem.resx
HZH_Controls/HZH_Controls/HZH_Controls.csproj
HZH_Controls/HZH_Controls/Properties/Resources.Designer.cs
HZH_Controls/HZH_Controls/Properties/Resources.resx
HZH_Controls/HZH_Controls/Resources/sanjiao1.png
HZH_Controls/HZH_Controls/Resources/sanjiao2.png
HZH_Controls/Test/Form1.Designer.cs
HZH_Controls/Test/Form1.cs
HZH_Controls/HZH_Controls/Controls/DataGridView/UCDataGridView.cs
查看文件 @
017189b
...
@@ -164,6 +164,8 @@ namespace HZH_Controls.Controls
...
@@ -164,6 +164,8 @@ namespace HZH_Controls.Controls
get
{
return
m_rowType
;
}
get
{
return
m_rowType
;
}
set
set
{
{
if
(
value
==
null
)
return
;
if
(!
typeof
(
IDataGridViewRow
).
IsAssignableFrom
(
value
)
||
!
value
.
IsSubclassOf
(
typeof
(
Control
)))
if
(!
typeof
(
IDataGridViewRow
).
IsAssignableFrom
(
value
)
||
!
value
.
IsSubclassOf
(
typeof
(
Control
)))
throw
new
Exception
(
"行控件没有实现IDataGridViewRow接口"
);
throw
new
Exception
(
"行控件没有实现IDataGridViewRow接口"
);
m_rowType
=
value
;
m_rowType
=
value
;
...
...
HZH_Controls/HZH_Controls/Controls/Menu/IMenuItem.cs
0 → 100644
查看文件 @
017189b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
public
interface
IMenuItem
{
event
EventHandler
SelectedItem
;
MenuItemEntity
DataSource
{
get
;
set
;
}
/// <summary>
/// 设置样式
/// </summary>
/// <param name="styles">key:属性名称,value:属性值</param>
void
SetStyle
(
Dictionary
<
string
,
object
>
styles
);
/// <summary>
/// 设置选中样式
/// </summary>
/// <param name="blnSelected">是否选中</param>
void
SetSelectedStyle
(
bool
blnSelected
);
}
}
HZH_Controls/HZH_Controls/Controls/Menu/MenuItemEntity.cs
0 → 100644
查看文件 @
017189b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HZH_Controls.Controls
{
[
Serializable
]
public
class
MenuItemEntity
{
/// <summary>
/// 键
/// </summary>
public
string
Key
{
get
;
set
;
}
/// <summary>
/// 文字
/// </summary>
public
string
Text
{
get
;
set
;
}
/// <summary>
/// 子节点
/// </summary>
public
List
<
MenuItemEntity
>
Childrens
{
get
;
set
;
}
/// <summary>
/// 自定义数据源,一般用于扩展展示,比如定义节点图片等
/// </summary>
public
object
DataSource
{
get
;
set
;
}
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenu.Designer.cs
0 → 100644
查看文件 @
017189b
namespace
HZH_Controls.Controls
{
partial
class
UCMenu
{
/// <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
();
//
// UCMenu
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScroll
=
true
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
20
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
39
)))));
this
.
Name
=
"UCMenu"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
204
,
468
);
this
.
ResumeLayout
(
false
);
}
#
endregion
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenu.cs
0 → 100644
查看文件 @
017189b
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
;
namespace
HZH_Controls.Controls
{
public
partial
class
UCMenu
:
UserControl
{
/// <summary>
/// 选中项事件
/// </summary>
public
event
EventHandler
SelectedItem
;
private
Type
m_parentItemType
=
typeof
(
UCMenuParentItem
);
/// <summary>
/// 父类节点类型
/// </summary>
public
Type
ParentItemType
{
get
{
return
m_parentItemType
;
}
set
{
if
(
value
==
null
)
return
;
if
(!
typeof
(
IMenuItem
).
IsAssignableFrom
(
value
)
||
!
value
.
IsSubclassOf
(
typeof
(
Control
)))
throw
new
Exception
(
"节点控件没有实现IMenuItem接口"
);
m_parentItemType
=
value
;
}
}
private
Type
m_childrenItemType
=
typeof
(
UCMenuChildrenItem
);
/// <summary>
/// 子类节点类型
/// </summary>
public
Type
ChildrenItemType
{
get
{
return
m_childrenItemType
;
}
set
{
if
(
value
==
null
)
return
;
if
(!
typeof
(
IMenuItem
).
IsAssignableFrom
(
value
)
||
!
value
.
IsSubclassOf
(
typeof
(
Control
)))
throw
new
Exception
(
"节点控件没有实现IMenuItem接口"
);
m_childrenItemType
=
value
;
}
}
private
Dictionary
<
string
,
object
>
m_parentItemStyles
;
/// <summary>
/// 父类节点样式设置,key:属性名称,value:属性值
/// </summary>
public
Dictionary
<
string
,
object
>
ParentItemStyles
{
get
{
return
m_parentItemStyles
;
}
set
{
m_parentItemStyles
=
value
;
}
}
private
Dictionary
<
string
,
object
>
m_childrenItemStyles
;
/// <summary>
/// 子类节点样式设置,key:属性名称,value:属性值
/// </summary>
public
Dictionary
<
string
,
object
>
ChildrenItemStyles
{
get
{
return
m_childrenItemStyles
;
}
set
{
m_childrenItemStyles
=
value
;
}
}
private
List
<
MenuItemEntity
>
m_dataSource
;
/// <summary>
/// 数据源
/// </summary>
public
List
<
MenuItemEntity
>
DataSource
{
get
{
return
m_dataSource
;
}
set
{
m_dataSource
=
value
;
ReloadItems
();
}
}
private
bool
m_isShowFirstItem
=
true
;
/// <summary>
/// 是否自动展开第一个节点
/// </summary>
public
bool
IsShowFirstItem
{
get
{
return
m_isShowFirstItem
;
}
set
{
m_isShowFirstItem
=
value
;
}
}
private
List
<
Control
>
m_lstParentItems
=
new
List
<
Control
>();
private
IMenuItem
m_selectParentItem
=
null
;
private
IMenuItem
m_selectChildrenItem
=
null
;
private
Panel
m_panChildren
=
null
;
private
void
ReloadItems
()
{
try
{
ControlHelper
.
FreezeControl
(
this
,
true
);
this
.
Controls
.
Clear
();
m_lstParentItems
.
Clear
();
if
(
m_dataSource
!=
null
&&
m_dataSource
.
Count
>
0
)
{
foreach
(
var
parent
in
m_dataSource
)
{
IMenuItem
parentItem
=
(
IMenuItem
)
Activator
.
CreateInstance
(
m_parentItemType
);
parentItem
.
DataSource
=
parent
;
if
(
m_parentItemStyles
!=
null
)
parentItem
.
SetStyle
(
m_parentItemStyles
);
parentItem
.
SelectedItem
+=
parentItem_SelectedItem
;
Control
c
=
parentItem
as
Control
;
c
.
Dock
=
DockStyle
.
Top
;
this
.
Controls
.
Add
(
c
);
this
.
Controls
.
SetChildIndex
(
c
,
0
);
m_lstParentItems
.
Add
(
c
);
}
}
m_panChildren
=
new
Panel
();
m_panChildren
.
Dock
=
DockStyle
.
Fill
;
m_panChildren
.
AutoScroll
=
true
;
this
.
Controls
.
Add
(
m_panChildren
);
this
.
Controls
.
SetChildIndex
(
m_panChildren
,
0
);
}
finally
{
ControlHelper
.
FreezeControl
(
this
,
false
);
}
if
(
m_isShowFirstItem
&&
m_lstParentItems
!=
null
&&
m_lstParentItems
.
Count
>
0
)
{
parentItem_SelectedItem
(
m_lstParentItems
[
0
],
null
);
}
}
void
parentItem_SelectedItem
(
object
sender
,
EventArgs
e
)
{
IMenuItem
item
=
sender
as
IMenuItem
;
if
(
m_lstParentItems
.
Contains
(
sender
as
Control
))
{
if
(
m_selectParentItem
!=
item
)
{
if
(
m_selectParentItem
!=
null
)
{
m_selectParentItem
.
SetSelectedStyle
(
false
);
}
m_selectParentItem
=
item
;
m_selectParentItem
.
SetSelectedStyle
(
true
);
SetChildrenControl
(
m_selectParentItem
);
}
else
{
m_selectParentItem
.
SetSelectedStyle
(
false
);
m_selectParentItem
=
null
;
SetChildrenControl
(
m_selectParentItem
,
false
);
}
}
else
if
(
m_panChildren
.
Controls
.
Contains
(
sender
as
Control
))
{
if
(
m_selectChildrenItem
!=
item
)
{
if
(
m_selectChildrenItem
!=
null
)
{
m_selectChildrenItem
.
SetSelectedStyle
(
false
);
}
m_selectChildrenItem
=
item
;
m_selectChildrenItem
.
SetSelectedStyle
(
true
);
}
}
if
(
SelectedItem
!=
null
)
{
SelectedItem
(
sender
,
e
);
}
}
private
void
SetChildrenControl
(
IMenuItem
menuitem
,
bool
blnChildren
=
true
)
{
try
{
ControlHelper
.
FreezeControl
(
this
,
true
);
if
(
blnChildren
)
{
Control
cMenu
=
menuitem
as
Control
;
int
index
=
m_lstParentItems
.
IndexOf
(
cMenu
);
for
(
int
i
=
0
;
i
<=
index
;
i
++)
{
m_lstParentItems
[
i
].
Dock
=
DockStyle
.
Top
;
this
.
Controls
.
SetChildIndex
(
m_lstParentItems
[
i
],
1
);
}
for
(
int
i
=
index
+
1
;
i
<
m_lstParentItems
.
Count
;
i
++)
{
m_lstParentItems
[
i
].
Dock
=
DockStyle
.
Bottom
;
this
.
Controls
.
SetChildIndex
(
m_lstParentItems
[
i
],
m_lstParentItems
.
Count
);
}
m_panChildren
.
Controls
.
Clear
();
int
intItemHeigth
=
0
;
foreach
(
var
item
in
menuitem
.
DataSource
.
Childrens
)
{
IMenuItem
parentItem
=
(
IMenuItem
)
Activator
.
CreateInstance
(
m_childrenItemType
);
parentItem
.
DataSource
=
item
;
if
(
m_childrenItemStyles
!=
null
)
parentItem
.
SetStyle
(
m_childrenItemStyles
);
parentItem
.
SelectedItem
+=
parentItem_SelectedItem
;
Control
c
=
parentItem
as
Control
;
if
(
intItemHeigth
==
0
)
intItemHeigth
=
c
.
Height
;
c
.
Dock
=
DockStyle
.
Top
;
m_panChildren
.
Controls
.
Add
(
c
);
m_panChildren
.
Controls
.
SetChildIndex
(
c
,
0
);
}
m_panChildren
.
MinimumSize
=
new
Size
(
0
,
menuitem
.
DataSource
.
Childrens
.
Count
*
intItemHeigth
);
}
else
{
m_panChildren
.
Controls
.
Clear
();
foreach
(
var
item
in
m_lstParentItems
)
{
item
.
Dock
=
DockStyle
.
Top
;
this
.
Controls
.
SetChildIndex
(
item
,
1
);
}
}
}
finally
{
ControlHelper
.
FreezeControl
(
this
,
false
);
}
}
public
UCMenu
()
{
InitializeComponent
();
}
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenu.resx
0 → 100644
查看文件 @
017189b
<?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
\ No newline at end of file
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuChildrenItem.Designer.cs
0 → 100644
查看文件 @
017189b
namespace
HZH_Controls.Controls
{
partial
class
UCMenuChildrenItem
{
/// <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
.
ucSplitLine_H1
=
new
HZH_Controls
.
Controls
.
UCSplitLine_H
();
this
.
lblTitle
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SuspendLayout
();
//
// ucSplitLine_H1
//
this
.
ucSplitLine_H1
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
29
)))),
((
int
)(((
byte
)(
43
)))),
((
int
)(((
byte
)(
54
)))));
this
.
ucSplitLine_H1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Bottom
;
this
.
ucSplitLine_H1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
59
);
this
.
ucSplitLine_H1
.
Name
=
"ucSplitLine_H1"
;
this
.
ucSplitLine_H1
.
Size
=
new
System
.
Drawing
.
Size
(
200
,
1
);
this
.
ucSplitLine_H1
.
TabIndex
=
0
;
this
.
ucSplitLine_H1
.
TabStop
=
false
;
//
// lblTitle
//
this
.
lblTitle
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
lblTitle
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
);
this
.
lblTitle
.
ForeColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
145
)))),
((
int
)(((
byte
)(
152
)))),
((
int
)(((
byte
)(
170
)))));
this
.
lblTitle
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
lblTitle
.
Name
=
"lblTitle"
;
this
.
lblTitle
.
Size
=
new
System
.
Drawing
.
Size
(
200
,
59
);
this
.
lblTitle
.
TabIndex
=
1
;
this
.
lblTitle
.
Text
=
"子项"
;
this
.
lblTitle
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// UCMenuChildrenItem
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
20
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
39
)))));
this
.
Controls
.
Add
(
this
.
lblTitle
);
this
.
Controls
.
Add
(
this
.
ucSplitLine_H1
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
Name
=
"UCMenuChildrenItem"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
200
,
60
);
this
.
ResumeLayout
(
false
);
}
#
endregion
private
UCSplitLine_H
ucSplitLine_H1
;
private
System
.
Windows
.
Forms
.
Label
lblTitle
;
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuChildrenItem.cs
0 → 100644
查看文件 @
017189b
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
;
namespace
HZH_Controls.Controls
{
/// <summary>
/// 子类节点
/// </summary>
[
ToolboxItem
(
false
)]
public
partial
class
UCMenuChildrenItem
:
UserControl
,
IMenuItem
{
public
event
EventHandler
SelectedItem
;
private
MenuItemEntity
m_dataSource
;
public
MenuItemEntity
DataSource
{
get
{
return
m_dataSource
;
}
set
{
m_dataSource
=
value
;
if
(
value
!=
null
)
{
lblTitle
.
Text
=
value
.
Text
;
}
}
}
public
UCMenuChildrenItem
()
{
InitializeComponent
();
this
.
lblTitle
.
MouseDown
+=
lblTitle_MouseDown
;
}
void
lblTitle_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
if
(
SelectedItem
!=
null
)
{
SelectedItem
(
this
,
null
);
}
}
public
void
SetStyle
(
Dictionary
<
string
,
object
>
styles
)
{
Type
t
=
this
.
GetType
();
foreach
(
var
item
in
styles
)
{
var
pro
=
t
.
GetProperty
(
item
.
Key
);
if
(
pro
!=
null
&&
pro
.
CanWrite
)
{
try
{
pro
.
SetValue
(
this
,
item
.
Value
,
null
);
}
catch
(
Exception
ex
)
{
throw
new
Exception
(
"菜单元素设置样式异常"
,
ex
);
}
}
}
}
public
void
SetSelectedStyle
(
bool
blnSelected
)
{
}
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuChildrenItem.resx
0 → 100644
查看文件 @
017189b
<?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
\ No newline at end of file
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuParentItem.Designer.cs
0 → 100644
查看文件 @
017189b
namespace
HZH_Controls.Controls
{
partial
class
UCMenuParentItem
{
/// <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
.
ucSplitLine_H1
=
new
HZH_Controls
.
Controls
.
UCSplitLine_H
();
this
.
lblTitle
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SuspendLayout
();
//
// ucSplitLine_H1
//
this
.
ucSplitLine_H1
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
20
)))),
((
int
)(((
byte
)(
30
)))),
((
int
)(((
byte
)(
39
)))));
this
.
ucSplitLine_H1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Bottom
;
this
.
ucSplitLine_H1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
59
);
this
.
ucSplitLine_H1
.
Name
=
"ucSplitLine_H1"
;
this
.
ucSplitLine_H1
.
Size
=
new
System
.
Drawing
.
Size
(
200
,
1
);
this
.
ucSplitLine_H1
.
TabIndex
=
0
;
this
.
ucSplitLine_H1
.
TabStop
=
false
;
//
// lblTitle
//
this
.
lblTitle
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
lblTitle
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
lblTitle
.
Image
=
global
::
HZH_Controls
.
Properties
.
Resources
.
sanjiao2
;
this
.
lblTitle
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblTitle
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
lblTitle
.
Name
=
"lblTitle"
;
this
.
lblTitle
.
Size
=
new
System
.
Drawing
.
Size
(
200
,
59
);
this
.
lblTitle
.
TabIndex
=
1
;
this
.
lblTitle
.
Text
=
"父项"
;
this
.
lblTitle
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// UCMenuParentItem
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
29
)))),
((
int
)(((
byte
)(
43
)))),
((
int
)(((
byte
)(
54
)))));
this
.
Controls
.
Add
(
this
.
lblTitle
);
this
.
Controls
.
Add
(
this
.
ucSplitLine_H1
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
Name
=
"UCMenuParentItem"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
200
,
60
);
this
.
ResumeLayout
(
false
);
}
#
endregion
private
UCSplitLine_H
ucSplitLine_H1
;
private
System
.
Windows
.
Forms
.
Label
lblTitle
;
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuParentItem.cs
0 → 100644
查看文件 @
017189b
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
;
namespace
HZH_Controls.Controls
{
/// <summary>
/// 父类节点
/// </summary>
[
ToolboxItem
(
false
)]
public
partial
class
UCMenuParentItem
:
UserControl
,
IMenuItem
{
public
event
EventHandler
SelectedItem
;
private
MenuItemEntity
m_dataSource
;
public
MenuItemEntity
DataSource
{
get
{
return
m_dataSource
;
}
set
{
m_dataSource
=
value
;
if
(
value
!=
null
)
{
lblTitle
.
Text
=
value
.
Text
;
}
}
}
public
UCMenuParentItem
()
{
InitializeComponent
();
lblTitle
.
MouseDown
+=
lblTitle_MouseDown
;
}
public
void
SetStyle
(
Dictionary
<
string
,
object
>
styles
)
{
Type
t
=
this
.
GetType
();
foreach
(
var
item
in
styles
)
{
var
pro
=
t
.
GetProperty
(
item
.
Key
);
if
(
pro
!=
null
&&
pro
.
CanWrite
)
{
try
{
pro
.
SetValue
(
this
,
item
.
Value
,
null
);
}
catch
(
Exception
ex
)
{
throw
new
Exception
(
"菜单元素设置样式异常"
,
ex
);
}
}
}
}
public
void
SetSelectedStyle
(
bool
blnSelected
)
{
if
(
blnSelected
)
{
this
.
lblTitle
.
Image
=
Properties
.
Resources
.
sanjiao1
;
}
else
{
this
.
lblTitle
.
Image
=
Properties
.
Resources
.
sanjiao2
;
}
}
void
lblTitle_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
if
(
SelectedItem
!=
null
)
{
SelectedItem
(
this
,
e
);
}
}
}
}
HZH_Controls/HZH_Controls/Controls/Menu/UCMenuParentItem.resx
0 → 100644
查看文件 @
017189b
<?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
\ No newline at end of file
HZH_Controls/HZH_Controls/HZH_Controls.csproj
查看文件 @
017189b
...
@@ -66,6 +66,26 @@
...
@@ -66,6 +66,26 @@
<Compile Include="Controls\List\UCPagerControl.Designer.cs">
<Compile Include="Controls\List\UCPagerControl.Designer.cs">
<DependentUpon>UCPagerControl.cs</DependentUpon>
<DependentUpon>UCPagerControl.cs</DependentUpon>
</Compile>
</Compile>
<Compile Include="Controls\Menu\IMenuItem.cs" />
<Compile Include="Controls\Menu\MenuItemEntity.cs" />
<Compile Include="Controls\Menu\UCMenu.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Menu\UCMenu.Designer.cs">
<DependentUpon>UCMenu.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Menu\UCMenuChildrenItem.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Menu\UCMenuChildrenItem.Designer.cs">
<DependentUpon>UCMenuChildrenItem.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Menu\UCMenuParentItem.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Menu\UCMenuParentItem.Designer.cs">
<DependentUpon>UCMenuParentItem.cs</DependentUpon>
</Compile>
<Compile Include="Helpers\ControlHelper.cs" />
<Compile Include="Helpers\ControlHelper.cs" />
<Compile Include="Controls\Btn\UCBtnExt.cs">
<Compile Include="Controls\Btn\UCBtnExt.cs">
<SubType>UserControl</SubType>
<SubType>UserControl</SubType>
...
@@ -352,6 +372,15 @@
...
@@ -352,6 +372,15 @@
<EmbeddedResource Include="Controls\List\UCPagerControlBase.resx">
<EmbeddedResource Include="Controls\List\UCPagerControlBase.resx">
<DependentUpon>UCPagerControlBase.cs</DependentUpon>
<DependentUpon>UCPagerControlBase.cs</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Menu\UCMenu.resx">
<DependentUpon>UCMenu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Menu\UCMenuChildrenItem.resx">
<DependentUpon>UCMenuChildrenItem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Menu\UCMenuParentItem.resx">
<DependentUpon>UCMenuParentItem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Process\ProcessExt.resx">
<EmbeddedResource Include="Controls\Process\ProcessExt.resx">
<DependentUpon>ProcessExt.cs</DependentUpon>
<DependentUpon>ProcessExt.cs</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
...
@@ -522,6 +551,12 @@
...
@@ -522,6 +551,12 @@
<ItemGroup>
<ItemGroup>
<None Include="Resources\first.png" />
<None Include="Resources\first.png" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="Resources\sanjiao2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\sanjiao1.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PropertyGroup>
<PreBuildEvent>md "$(TargetDir)HandInput"
<PreBuildEvent>md "$(TargetDir)HandInput"
...
...
HZH_Controls/HZH_Controls/Properties/Resources.Designer.cs
查看文件 @
017189b
...
@@ -383,6 +383,26 @@ namespace HZH_Controls.Properties {
...
@@ -383,6 +383,26 @@ namespace HZH_Controls.Properties {
/// <summary>
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
/// </summary>
internal
static
System
.
Drawing
.
Bitmap
sanjiao1
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"sanjiao1"
,
resourceCulture
);
return
((
System
.
Drawing
.
Bitmap
)(
obj
));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal
static
System
.
Drawing
.
Bitmap
sanjiao2
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"sanjiao2"
,
resourceCulture
);
return
((
System
.
Drawing
.
Bitmap
)(
obj
));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal
static
System
.
Drawing
.
Bitmap
success
{
internal
static
System
.
Drawing
.
Bitmap
success
{
get
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"success"
,
resourceCulture
);
object
obj
=
ResourceManager
.
GetObject
(
"success"
,
resourceCulture
);
...
...
HZH_Controls/HZH_Controls/Properties/Resources.resx
查看文件 @
017189b
...
@@ -223,4 +223,10 @@
...
@@ -223,4 +223,10 @@
<data name="right" type="System.Resources.ResXFileRef, System.Windows.Forms">
<data name="right" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Resources\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</data>
<data name="sanjiao1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sanjiao1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sanjiao2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sanjiao2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
HZH_Controls/HZH_Controls/Resources/sanjiao1.png
0 → 100644
查看文件 @
017189b
279 字节
HZH_Controls/HZH_Controls/Resources/sanjiao2.png
0 → 100644
查看文件 @
017189b
300 字节
HZH_Controls/Test/Form1.Designer.cs
查看文件 @
017189b
此文件的差异被折叠,
点击展开。
HZH_Controls/Test/Form1.cs
查看文件 @
017189b
...
@@ -64,6 +64,30 @@ namespace Test
...
@@ -64,6 +64,30 @@ namespace Test
}
}
this
.
ucHorizontalList1
.
DataSource
=
lstHL
;
this
.
ucHorizontalList1
.
DataSource
=
lstHL
;
List
<
MenuItemEntity
>
lstMenu
=
new
List
<
MenuItemEntity
>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
MenuItemEntity
item
=
new
MenuItemEntity
()
{
Key
=
"p"
+
i
.
ToString
(),
Text
=
"菜单项"
+
i
,
DataSource
=
"这里编写一些自定义的数据源,用于扩展"
};
item
.
Childrens
=
new
List
<
MenuItemEntity
>();
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
MenuItemEntity
item2
=
new
MenuItemEntity
()
{
Key
=
"c"
+
i
.
ToString
(),
Text
=
"菜单子项"
+
i
+
"-"
+
j
,
DataSource
=
"这里编写一些自定义的数据源,用于扩展"
};
item
.
Childrens
.
Add
(
item2
);
}
lstMenu
.
Add
(
item
);
}
this
.
ucMenu1
.
DataSource
=
lstMenu
;
}
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论