(八十四)c#Winform自定义控件-导航菜单(类Office菜单)
官网
前提
入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。
GitHub:https://github.com/kwwwvagaa/NetWinformControl
码云:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
如果觉得写的还行,请点个 star 支持一下吧
欢迎前来交流探讨: 企鹅群568015492 
来都来了,点个【推荐】再走吧,谢谢
NuGet
Install-Package HZH_Controls
目录
https://www.cnblogs.com/bfyx/p/11364884.html
用处及效果

准备工作
没什么准备的,就是组装控件
开始
添加一个用户控件UCNavigationMenuOffice
添加属性
/// <summary>
/// The main menu height
/// </summary>
private int mainMenuHeight = ; /// <summary>
/// Gets or sets the height of the main menu.
/// </summary>
/// <value>The height of the main menu.</value>
[Description("主菜单高度,大于20的值"), Category("自定义")]
public int MainMenuHeight
{
get { return mainMenuHeight; }
set
{
if (value < )
return;
mainMenuHeight = value;
this.panMenu.Height = value;
}
}
/// <summary>
/// The expand height
/// </summary>
private int expandHeight = ;
/// <summary>
/// Gets or sets the height of the expand.
/// </summary>
/// <value>The height of the expand.</value>
[Description("展开后高度"), Category("自定义")]
public int ExpandHeight
{
get { return expandHeight; }
set { expandHeight = value; }
}
/// <summary>
/// The is expand
/// </summary>
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("自定义")]
public bool IsExpand
{
get { return isExpand; }
set
{
isExpand = value;
if (value)
{
this.Height = expandHeight;
ResetChildControl();
}
else
{
this.Height = this.panMenu.Height;
this.panChilds.Controls.Clear();
}
}
}
/// <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();
if (value != null && value.Length > )
{
selectItem = value[];
ResetChildControl();
}
}
}
/// <summary>
/// The tip color
/// </summary>
private Color tipColor = Color.FromArgb(, , ); /// <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>();
一些事件及辅助函数,处理大小改变时候和重新加载以及鼠标对应处理
/// <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)
{
if (isExpand)
{
expandHeight = this.Height;
}
} /// <summary>
/// Resets the child control.
/// </summary>
public void ResetChildControl()
{
if (isExpand)
{
if (selectItem != null)
{
try
{
ControlHelper.FreezeControl(this, true);
this.panChilds.Controls.Clear();
if (selectItem.ShowControl != null)
{
HZH_Controls.Controls.UCSplitLine_H split = new UCSplitLine_H();
split.BackColor = Color.FromArgb(, , , );
split.Dock = DockStyle.Top;
this.panChilds.Controls.Add(split);
split.BringToFront();
this.panChilds.Controls.Add(selectItem.ShowControl);
selectItem.ShowControl.Dock = DockStyle.Fill;
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
}
}
} /// <summary>
/// Reloads the menu.
/// </summary>
private void ReloadMenu()
{
try
{
ControlHelper.FreezeControl(this, true);
this.panMenu.Controls.Clear();
if (items != null && items.Length > )
{
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;
lbl.DoubleClick += lbl_DoubleClick;
if (menu.AnchorRight)
{
lbl.Dock = DockStyle.Right;
}
else
{
lbl.Dock = DockStyle.Left;
}
this.panMenu.Controls.Add(lbl); lbl.BringToFront();
}
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
} /// <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)
{
IsExpand = !IsExpand;
}
/// <summary>
/// Handles the Click 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_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; if (ClickItemed != null)
{
ClickItemed(this, e);
}
}
else
{
if (IsExpand)
{
selectItem = menu;
ResetChildControl();
}
}
}
}
/// <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)
{
if (!IsExpand)
{
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(panMenu, menu.ShowControl, isNotFocus: false); }
m_lstAnchors[menu].BackColor = this.BackColor;
m_lstAnchors[menu].Show(this);
m_lstAnchors[menu].Size = new Size(this.panChilds.Width, expandHeight - mainMenuHeight);
}
}
}
/// <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 - , lbl.Height / - , , );
var path = rect.CreateRoundedRectanglePath();
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 - , lbl.Height / - , , ));
}
}
if (menu.Icon != null)
{
e.Graphics.DrawImage(menu.Icon, new Rectangle(, (lbl.Height - ) / , , ), , , menu.Icon.Width, menu.Icon.Height, GraphicsUnit.Pixel);
}
}
}
完整代码
// ***********************************************************************
// 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.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
{
/// <summary>
/// Class UCNavigationMenuOffice.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public partial class UCNavigationMenuOffice : UserControl
{
/// <summary>
/// The main menu height
/// </summary>
private int mainMenuHeight = ; /// <summary>
/// Gets or sets the height of the main menu.
/// </summary>
/// <value>The height of the main menu.</value>
[Description("主菜单高度,大于20的值"), Category("自定义")]
public int MainMenuHeight
{
get { return mainMenuHeight; }
set
{
if (value < )
return;
mainMenuHeight = value;
this.panMenu.Height = value;
}
}
/// <summary>
/// The expand height
/// </summary>
private int expandHeight = ;
/// <summary>
/// Gets or sets the height of the expand.
/// </summary>
/// <value>The height of the expand.</value>
[Description("展开后高度"), Category("自定义")]
public int ExpandHeight
{
get { return expandHeight; }
set { expandHeight = value; }
}
/// <summary>
/// The is expand
/// </summary>
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("自定义")]
public bool IsExpand
{
get { return isExpand; }
set
{
isExpand = value;
if (value)
{
this.Height = expandHeight;
ResetChildControl();
}
else
{
this.Height = this.panMenu.Height;
this.panChilds.Controls.Clear();
}
}
}
/// <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();
if (value != null && value.Length > )
{
selectItem = value[];
ResetChildControl();
}
}
}
/// <summary>
/// The tip color
/// </summary>
private Color tipColor = Color.FromArgb(, , ); /// <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>();
/// <summary>
/// Initializes a new instance of the <see cref="UCNavigationMenuOffice"/> class.
/// </summary>
public UCNavigationMenuOffice()
{
InitializeComponent();
this.SizeChanged += UCNavigationMenuOffice_SizeChanged;
items = new NavigationMenuItemExt[];
if (ControlHelper.IsDesignMode())
{
items = new NavigationMenuItemExt[];
for (int i = ; i < ; i++)
{
items[i] = new NavigationMenuItemExt()
{
Text = "菜单" + (i + ),
AnchorRight = i >=
};
}
}
} /// <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)
{
if (isExpand)
{
expandHeight = this.Height;
}
} /// <summary>
/// Resets the child control.
/// </summary>
public void ResetChildControl()
{
if (isExpand)
{
if (selectItem != null)
{
try
{
ControlHelper.FreezeControl(this, true);
this.panChilds.Controls.Clear();
if (selectItem.ShowControl != null)
{
HZH_Controls.Controls.UCSplitLine_H split = new UCSplitLine_H();
split.BackColor = Color.FromArgb(, , , );
split.Dock = DockStyle.Top;
this.panChilds.Controls.Add(split);
split.BringToFront();
this.panChilds.Controls.Add(selectItem.ShowControl);
selectItem.ShowControl.Dock = DockStyle.Fill;
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
}
}
} /// <summary>
/// Reloads the menu.
/// </summary>
private void ReloadMenu()
{
try
{
ControlHelper.FreezeControl(this, true);
this.panMenu.Controls.Clear();
if (items != null && items.Length > )
{
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;
lbl.DoubleClick += lbl_DoubleClick;
if (menu.AnchorRight)
{
lbl.Dock = DockStyle.Right;
}
else
{
lbl.Dock = DockStyle.Left;
}
this.panMenu.Controls.Add(lbl); lbl.BringToFront();
}
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
} /// <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)
{
IsExpand = !IsExpand;
}
/// <summary>
/// Handles the Click 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_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; if (ClickItemed != null)
{
ClickItemed(this, e);
}
}
else
{
if (IsExpand)
{
selectItem = menu;
ResetChildControl();
}
}
}
}
/// <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)
{
if (!IsExpand)
{
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(panMenu, menu.ShowControl, isNotFocus: false); }
m_lstAnchors[menu].BackColor = this.BackColor;
m_lstAnchors[menu].Show(this);
m_lstAnchors[menu].Size = new Size(this.panChilds.Width, expandHeight - mainMenuHeight);
}
}
}
/// <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 - , lbl.Height / - , , );
var path = rect.CreateRoundedRectanglePath();
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 - , lbl.Height / - , , ));
}
}
if (menu.Icon != null)
{
e.Graphics.DrawImage(menu.Icon, new Rectangle(, (lbl.Height - ) / , , ), , , menu.Icon.Width, menu.Icon.Height, GraphicsUnit.Pixel);
}
}
}
}
}
最后的话
如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星星吧
(八十四)c#Winform自定义控件-导航菜单(类Office菜单)的更多相关文章
- (八十三)c#Winform自定义控件-导航菜单(扩展)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
- (八十)c#Winform自定义控件-分割线标签-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- 第三百八十四节,Django+Xadmin打造上线标准的在线教育平台—路由映射与静态文件配置以及会员注册
第三百八十四节,Django+Xadmin打造上线标准的在线教育平台—路由映射与静态文件配置以及会员注册 基于类的路由映射 from django.conf.urls import url, incl ...
- “全栈2019”Java第八十四章:接口中嵌套接口详解
难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...
- 孤荷凌寒自学python第八十四天搭建jTessBoxEditor来训练tesseract模块
孤荷凌寒自学python第八十四天搭建jTessBoxEditor来训练tesseract模块 (完整学习过程屏幕记录视频地址在文末) 由于本身tesseract模块针对普通的验证码图片的识别率并不高 ...
- 《手把手教你》系列基础篇(八十四)-java+ selenium自动化测试-框架设计基础-TestNG日志-上篇(详解教程)
1.简介 TestNG还为我们提供了测试的记录功能-日志.例如,在运行测试用例期间,用户希望在控制台中记录一些信息.信息可以是任何细节取决于目的.牢记我们正在使用Selenium进行测试,我们需要有助 ...
- (七十九)c#Winform自定义控件-导航菜单
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
- (三十)c#Winform自定义控件-文本框(三)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- (二十)c#Winform自定义控件-有后退的窗体
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- (五十)c#Winform自定义控件-滑块
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
随机推荐
- CentSO7.6下部署Maridb Galera Cluster 实践记录(一)
根据目前系统业务发展,预计未来上集成的概率异常之高,所以提前学习如何部署,网上尽管有很多这方面资料,但是真正适合自己的只有实践过的. 很奇怪目前的yum资源库里面为什么没有galera资源,目前只能通 ...
- 代码整洁 vs 代码肮脏
写出整洁的代码,是每个程序员的追求.<clean code>指出,要想写出好的代码,首先得知道什么是肮脏代码.什么是整洁代码:然后通过大量的刻意练习,才能真正写出整洁的代码. WTF/mi ...
- Linux 笔记 - 第十四章 LAMP 之(二) 环境配置
博客地址:http://www.moonxy.com 一.前言 LAMP 环境搭建好之后,其实仅仅是安装上了软件,我们还需要掌握 httpd 和 PHP 的配置. 二.httpd 配置 2.1 创建虚 ...
- 03 jvm的组成
声明:本博客仅仅是一个初学者的学习记录.心得总结,其中肯定有许多错误,不具有参考价值,欢迎大佬指正,谢谢!想和我交流.一起学习.一起进步的朋友可以加我微信Liu__66666666 这是简单学习一遍之 ...
- 探索form组件和cookie,session组件
一. 实现注册功能 后端代码: from django.shortcuts import render,HttpResponse,redirect from app01 import models C ...
- MOOC C++笔记(四):运算符重载
第四周:运算符重载 基本概念 运算符重载,就是对已有的运算符(C++中预定义的运算符)赋予多重的含义,使同一运算符作用于不同类型的数据时导致不同类型的行为. 运算符重载的目的是:扩展C++中提供的运算 ...
- 06 (OC)* iOS中UI类之间的继承关系
iOS中UI类之间的继承关系 此图可以更好的让你去理解iOS中一些底层的关系.你能够了解以及理解UI类之间的继承关系,你会更加明白苹果有关于底层的东西,更有助于你的项目开发由它们的底层关系,就能更加容 ...
- Transformer各层网络结构详解!面试必备!(附代码实现)
1. 什么是Transformer <Attention Is All You Need>是一篇Google提出的将Attention思想发挥到极致的论文.这篇论文中提出一个全新的模型,叫 ...
- 重学JavaScript之面向对象的程序设计(继承)
1. 继承 ES 中只支持实现继承,而且其实现继承主要依靠原型链来实现的. 2. 原型链 ES中 描述了 原型链的概念,并将原型链作为实现继承的主要方法.其基本思想是利用原型让一个引用类型继承另一个引 ...
- 2019年十大开源WEB应用防火墙点评
2019年十大开源WEB应用防火墙点评 随着WEB应用的爆炸式成长和HTTPS加密的普及,针对网络应用层的攻击,像SQL注入.跨站脚本攻击.参数篡改.应用平台漏洞攻击.拒绝服务攻击等越来越多,传统的防 ...