Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ba5c3e1e
由
HZH
编写于
2019-10-12 10:49:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
添加描述信息
1 个父辈
ef82d00c
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
59 行增加
和
2 行删除
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuOffice.cs
HZH_Controls/HZH_Controls/Controls/NavigationMenu/UCNavigationMenuOffice.cs
查看文件 @
ba5c3e1
using
System
;
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 2019-10-12
//
// ***********************************************************************
// <copyright file="UCNavigationMenuOffice.cs">
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
// </copyright>
//
// Blog: https://www.cnblogs.com/bfyx
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
//
// If you use this code, please keep this note.
// ***********************************************************************
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Drawing
;
...
@@ -10,10 +25,22 @@ using HZH_Controls.Forms;
...
@@ -10,10 +25,22 @@ using HZH_Controls.Forms;
namespace
HZH_Controls.Controls
namespace
HZH_Controls.Controls
{
{
/// <summary>
/// Class UCNavigationMenuOffice.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public
partial
class
UCNavigationMenuOffice
:
UserControl
public
partial
class
UCNavigationMenuOffice
:
UserControl
{
{
/// <summary>
/// The main menu height
/// </summary>
private
int
mainMenuHeight
=
25
;
private
int
mainMenuHeight
=
25
;
/// <summary>
/// Gets or sets the height of the main menu.
/// </summary>
/// <value>The height of the main menu.</value>
[
Description
(
"主菜单高度,大于20的值"
),
Category
(
"自定义"
)]
[
Description
(
"主菜单高度,大于20的值"
),
Category
(
"自定义"
)]
public
int
MainMenuHeight
public
int
MainMenuHeight
{
{
...
@@ -26,14 +53,28 @@ namespace HZH_Controls.Controls
...
@@ -26,14 +53,28 @@ namespace HZH_Controls.Controls
this
.
panMenu
.
Height
=
value
;
this
.
panMenu
.
Height
=
value
;
}
}
}
}
/// <summary>
/// The expand height
/// </summary>
private
int
expandHeight
=
125
;
private
int
expandHeight
=
125
;
/// <summary>
/// Gets or sets the height of the expand.
/// </summary>
/// <value>The height of the expand.</value>
[
Description
(
"展开后高度"
),
Category
(
"自定义"
)]
[
Description
(
"展开后高度"
),
Category
(
"自定义"
)]
public
int
ExpandHeight
public
int
ExpandHeight
{
{
get
{
return
expandHeight
;
}
get
{
return
expandHeight
;
}
set
{
expandHeight
=
value
;
}
set
{
expandHeight
=
value
;
}
}
}
/// <summary>
/// The is expand
/// </summary>
private
bool
isExpand
=
true
;
private
bool
isExpand
=
true
;
/// <summary>
/// Gets or sets a value indicating whether this instance is expand.
/// </summary>
/// <value><c>true</c> if this instance is expand; otherwise, <c>false</c>.</value>
[
Description
(
"是否展开"
),
Category
(
"自定义"
)]
[
Description
(
"是否展开"
),
Category
(
"自定义"
)]
public
bool
IsExpand
public
bool
IsExpand
{
{
...
@@ -167,6 +208,9 @@ namespace HZH_Controls.Controls
...
@@ -167,6 +208,9 @@ namespace HZH_Controls.Controls
/// The m LST anchors
/// The m LST anchors
/// </summary>
/// </summary>
Dictionary
<
NavigationMenuItemExt
,
FrmAnchor
>
m_lstAnchors
=
new
Dictionary
<
NavigationMenuItemExt
,
FrmAnchor
>();
Dictionary
<
NavigationMenuItemExt
,
FrmAnchor
>
m_lstAnchors
=
new
Dictionary
<
NavigationMenuItemExt
,
FrmAnchor
>();
/// <summary>
/// Initializes a new instance of the <see cref="UCNavigationMenuOffice"/> class.
/// </summary>
public
UCNavigationMenuOffice
()
public
UCNavigationMenuOffice
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -186,6 +230,11 @@ namespace HZH_Controls.Controls
...
@@ -186,6 +230,11 @@ namespace HZH_Controls.Controls
}
}
}
}
/// <summary>
/// Handles the SizeChanged event of the UCNavigationMenuOffice 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
UCNavigationMenuOffice_SizeChanged
(
object
sender
,
EventArgs
e
)
void
UCNavigationMenuOffice_SizeChanged
(
object
sender
,
EventArgs
e
)
{
{
if
(
isExpand
)
if
(
isExpand
)
...
@@ -194,6 +243,9 @@ namespace HZH_Controls.Controls
...
@@ -194,6 +243,9 @@ namespace HZH_Controls.Controls
}
}
}
}
/// <summary>
/// Resets the child control.
/// </summary>
public
void
ResetChildControl
()
public
void
ResetChildControl
()
{
{
if
(
isExpand
)
if
(
isExpand
)
...
@@ -272,6 +324,11 @@ namespace HZH_Controls.Controls
...
@@ -272,6 +324,11 @@ namespace HZH_Controls.Controls
}
}
}
}
/// <summary>
/// Handles the DoubleClick 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_DoubleClick
(
object
sender
,
EventArgs
e
)
void
lbl_DoubleClick
(
object
sender
,
EventArgs
e
)
{
{
IsExpand
=
!
IsExpand
;
IsExpand
=
!
IsExpand
;
...
@@ -280,7 +337,7 @@ namespace HZH_Controls.Controls
...
@@ -280,7 +337,7 @@ namespace HZH_Controls.Controls
/// Handles the Click event of the lbl control.
/// Handles the Click event of the lbl control.
/// </summary>
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
/// <param name="e">The <see cref="EventArgs"
/> instance containing the event data.</param>
void
lbl_Click
(
object
sender
,
EventArgs
e
)
void
lbl_Click
(
object
sender
,
EventArgs
e
)
{
{
Label
lbl
=
sender
as
Label
;
Label
lbl
=
sender
as
Label
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论