官网

http://www.hzhcontrols.com

前提

入行已经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

用处及效果

准备工作

依然是GDI+  不了解请先百度一下

开始

添加一个类UCBottle,继承UserControl

添加几个控制属性

 //瓶身区域
/// <summary>
/// The m working rect
/// </summary>
Rectangle m_workingRect; /// <summary>
/// The title
/// </summary>
string title = "瓶子1"; /// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[Description("标题"), Category("自定义")]
public string Title
{
get { return title; }
set
{
title = value;
ResetWorkingRect();
Refresh();
}
} /// <summary>
/// The bottle color
/// </summary>
private Color bottleColor = Color.FromArgb(, , ); /// <summary>
/// Gets or sets the color of the bottle.
/// </summary>
/// <value>The color of the bottle.</value>
[Description("瓶子颜色"), Category("自定义")]
public Color BottleColor
{
get { return bottleColor; }
set
{
bottleColor = value;
Refresh();
}
} /// <summary>
/// The bottle mouth color
/// </summary>
private Color bottleMouthColor = Color.FromArgb(, , ); /// <summary>
/// Gets or sets the color of the bottle mouth.
/// </summary>
/// <value>The color of the bottle mouth.</value>
[Description("瓶口颜色"), Category("自定义")]
public Color BottleMouthColor
{
get { return bottleMouthColor; }
set { bottleMouthColor = value; }
} /// <summary>
/// The liquid color
/// </summary>
private Color liquidColor = Color.FromArgb(, , ); /// <summary>
/// Gets or sets the color of the liquid.
/// </summary>
/// <value>The color of the liquid.</value>
[Description("液体颜色"), Category("自定义")]
public Color LiquidColor
{
get { return liquidColor; }
set
{
liquidColor = value;
Refresh();
}
} /// <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>
[Description("文字字体"), Category("自定义")]
public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
ResetWorkingRect();
Refresh();
}
} /// <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>
[Description("文字颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
Refresh();
}
} /// <summary>
/// The maximum value
/// </summary>
private decimal maxValue = ; /// <summary>
/// Gets or sets the maximum value.
/// </summary>
/// <value>The maximum value.</value>
[Description("最大值"), Category("自定义")]
public decimal MaxValue
{
get { return maxValue; }
set
{
if (value < m_value)
return;
maxValue = value;
Refresh();
}
} /// <summary>
/// The m value
/// </summary>
private decimal m_value = ; /// <summary>
/// Gets or sets the value.
/// </summary>
/// <value>The value.</value>
[Description("值"), Category("自定义")]
public decimal Value
{
get { return m_value; }
set
{
if (value <= || value > maxValue)
return;
m_value = value;
Refresh();
}
} /// <summary>
/// The m no
/// </summary>
private string m_NO;
/// <summary>
/// Gets or sets the NO.
/// </summary>
/// <value>The no.</value>
[Description("编号"), Category("自定义")]
public string NO
{
get { return m_NO; }
set
{
m_NO = value;
Refresh();
}
}

重绘

  protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SetGDIHigh();
//写文字
var size = g.MeasureString(title, Font);
g.DrawString(title, Font, new SolidBrush(ForeColor), new PointF((this.Width - size.Width) / , )); //画空瓶子
GraphicsPath pathPS = new GraphicsPath();
Point[] psPS = new Point[]
{
new Point(m_workingRect.Left, m_workingRect.Top),
new Point(m_workingRect.Right - , m_workingRect.Top),
new Point(m_workingRect.Right - , m_workingRect.Bottom - ),
new Point(m_workingRect.Right - - m_workingRect.Width / , m_workingRect.Bottom),
new Point(m_workingRect.Left + m_workingRect.Width / , m_workingRect.Bottom),
new Point(m_workingRect.Left, m_workingRect.Bottom - ),
};
pathPS.AddLines(psPS);
pathPS.CloseAllFigures();
g.FillPath(new SolidBrush(bottleColor), pathPS);
//画液体
decimal decYTHeight = (m_value / maxValue) * m_workingRect.Height;
GraphicsPath pathYT = new GraphicsPath();
Rectangle rectYT = Rectangle.Empty;
if (decYTHeight < )
{
PointF[] psYT = new PointF[]
{
new PointF((float)(m_workingRect.Left+(-decYTHeight))+,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF((float)(m_workingRect.Right-(-decYTHeight))-,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF(m_workingRect.Right--m_workingRect.Width/, m_workingRect.Bottom),
new PointF(m_workingRect.Left+m_workingRect.Width/, m_workingRect.Bottom),
};
pathYT.AddLines(psYT);
pathYT.CloseAllFigures();
rectYT = new Rectangle((m_workingRect.Left + ( - (int)decYTHeight)) + , m_workingRect.Bottom - (int)decYTHeight - , m_workingRect.Width - (int)( - decYTHeight) * - , );
}
else
{
PointF[] psYT = new PointF[]
{
new PointF(m_workingRect.Left,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF(m_workingRect.Right-,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF(m_workingRect.Right-,m_workingRect.Bottom-),
new PointF(m_workingRect.Right--m_workingRect.Width/, m_workingRect.Bottom),
new PointF(m_workingRect.Left+m_workingRect.Width/, m_workingRect.Bottom),
new PointF(m_workingRect.Left,m_workingRect.Bottom-),
};
pathYT.AddLines(psYT);
pathYT.CloseAllFigures();
rectYT = new Rectangle(m_workingRect.Left, m_workingRect.Bottom - (int)decYTHeight - , m_workingRect.Width, );
} g.FillPath(new SolidBrush(liquidColor), pathYT);
g.FillPath(new SolidBrush(Color.FromArgb(, bottleMouthColor)), pathYT);
//画液体面
g.FillEllipse(new SolidBrush(liquidColor), rectYT);
g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), rectYT); //画高亮
int intCount = m_workingRect.Width / / ;
int intSplit = ( - ) / intCount;
for (int i = ; i < intCount; i++)
{
int _penWidth = m_workingRect.Width / - * i;
if (_penWidth <= )
_penWidth = ;
g.DrawLine(new Pen(new SolidBrush(Color.FromArgb(, Color.White)), _penWidth), new Point(m_workingRect.Width / , m_workingRect.Top), new Point(m_workingRect.Width / , m_workingRect.Bottom - ));
if (_penWidth == )
break;
} //画瓶底
g.FillEllipse(new SolidBrush(bottleColor), new RectangleF(m_workingRect.Left, m_workingRect.Top - , m_workingRect.Width - , ));
g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), new RectangleF(m_workingRect.Left, m_workingRect.Top - , m_workingRect.Width - , ));
//画瓶口
g.FillRectangle(new SolidBrush(bottleMouthColor), new Rectangle(m_workingRect.Left + m_workingRect.Width / , m_workingRect.Bottom, m_workingRect.Width / , ));
//画瓶颈阴影
GraphicsPath pathPJ = new GraphicsPath();
Point[] psPJ = new Point[]
{
new Point(m_workingRect.Left, m_workingRect.Bottom-),
new Point(m_workingRect.Right-, m_workingRect.Bottom-),
new Point(m_workingRect.Right--m_workingRect.Width/, m_workingRect.Bottom),
new Point(m_workingRect.Left+m_workingRect.Width/, m_workingRect.Bottom)
};
pathPJ.AddLines(psPJ);
pathPJ.CloseAllFigures();
g.FillPath(new SolidBrush(Color.FromArgb(, bottleMouthColor)), pathPJ); //写编号
if (!string.IsNullOrEmpty(m_NO))
{
var nosize = g.MeasureString(m_NO, Font);
g.DrawString(m_NO, Font, new SolidBrush(ForeColor), new PointF((this.Width - nosize.Width) / , m_workingRect.Top + ));
}
}

代码就这么多

完整代码

 // ***********************************************************************
// Assembly : HZH_Controls
// Created : 2019-09-05
//
// ***********************************************************************
// <copyright file="UCBottle.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.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel; namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCBottle.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public class UCBottle : UserControl
{
//瓶身区域
/// <summary>
/// The m working rect
/// </summary>
Rectangle m_workingRect; /// <summary>
/// The title
/// </summary>
string title = "瓶子1"; /// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[Description("标题"), Category("自定义")]
public string Title
{
get { return title; }
set
{
title = value;
ResetWorkingRect();
Refresh();
}
} /// <summary>
/// The bottle color
/// </summary>
private Color bottleColor = Color.FromArgb(, , ); /// <summary>
/// Gets or sets the color of the bottle.
/// </summary>
/// <value>The color of the bottle.</value>
[Description("瓶子颜色"), Category("自定义")]
public Color BottleColor
{
get { return bottleColor; }
set
{
bottleColor = value;
Refresh();
}
} /// <summary>
/// The bottle mouth color
/// </summary>
private Color bottleMouthColor = Color.FromArgb(, , ); /// <summary>
/// Gets or sets the color of the bottle mouth.
/// </summary>
/// <value>The color of the bottle mouth.</value>
[Description("瓶口颜色"), Category("自定义")]
public Color BottleMouthColor
{
get { return bottleMouthColor; }
set { bottleMouthColor = value; }
} /// <summary>
/// The liquid color
/// </summary>
private Color liquidColor = Color.FromArgb(, , ); /// <summary>
/// Gets or sets the color of the liquid.
/// </summary>
/// <value>The color of the liquid.</value>
[Description("液体颜色"), Category("自定义")]
public Color LiquidColor
{
get { return liquidColor; }
set
{
liquidColor = value;
Refresh();
}
} /// <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>
[Description("文字字体"), Category("自定义")]
public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
ResetWorkingRect();
Refresh();
}
} /// <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>
[Description("文字颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
Refresh();
}
} /// <summary>
/// The maximum value
/// </summary>
private decimal maxValue = ; /// <summary>
/// Gets or sets the maximum value.
/// </summary>
/// <value>The maximum value.</value>
[Description("最大值"), Category("自定义")]
public decimal MaxValue
{
get { return maxValue; }
set
{
if (value < m_value)
return;
maxValue = value;
Refresh();
}
} /// <summary>
/// The m value
/// </summary>
private decimal m_value = ; /// <summary>
/// Gets or sets the value.
/// </summary>
/// <value>The value.</value>
[Description("值"), Category("自定义")]
public decimal Value
{
get { return m_value; }
set
{
if (value <= || value > maxValue)
return;
m_value = value;
Refresh();
}
} /// <summary>
/// The m no
/// </summary>
private string m_NO;
/// <summary>
/// Gets or sets the NO.
/// </summary>
/// <value>The no.</value>
[Description("编号"), Category("自定义")]
public string NO
{
get { return m_NO; }
set
{
m_NO = value;
Refresh();
}
} /// <summary>
/// Initializes a new instance of the <see cref="UCBottle" /> class.
/// </summary>
public UCBottle()
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.SizeChanged += UCBottle_SizeChanged;
this.Size = new Size(, );
} /// <summary>
/// Handles the SizeChanged event of the UCBottle 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 UCBottle_SizeChanged(object sender, EventArgs e)
{
ResetWorkingRect();
} /// <summary>
/// Resets the working rect.
/// </summary>
private void ResetWorkingRect()
{
var g = this.CreateGraphics();
var size = g.MeasureString(title, Font);
m_workingRect = new Rectangle(, (int)size.Height + , this.Width, this.Height - ((int)size.Height + ) - );
} /// <summary>
/// 引发 <see cref="E:System.Windows.Forms.Control.Paint" /> 事件。
/// </summary>
/// <param name="e">包含事件数据的 <see cref="T:System.Windows.Forms.PaintEventArgs" />。</param>
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SetGDIHigh();
//写文字
var size = g.MeasureString(title, Font);
g.DrawString(title, Font, new SolidBrush(ForeColor), new PointF((this.Width - size.Width) / , )); //画空瓶子
GraphicsPath pathPS = new GraphicsPath();
Point[] psPS = new Point[]
{
new Point(m_workingRect.Left, m_workingRect.Top),
new Point(m_workingRect.Right - , m_workingRect.Top),
new Point(m_workingRect.Right - , m_workingRect.Bottom - ),
new Point(m_workingRect.Right - - m_workingRect.Width / , m_workingRect.Bottom),
new Point(m_workingRect.Left + m_workingRect.Width / , m_workingRect.Bottom),
new Point(m_workingRect.Left, m_workingRect.Bottom - ),
};
pathPS.AddLines(psPS);
pathPS.CloseAllFigures();
g.FillPath(new SolidBrush(bottleColor), pathPS);
//画液体
decimal decYTHeight = (m_value / maxValue) * m_workingRect.Height;
GraphicsPath pathYT = new GraphicsPath();
Rectangle rectYT = Rectangle.Empty;
if (decYTHeight < )
{
PointF[] psYT = new PointF[]
{
new PointF((float)(m_workingRect.Left+(-decYTHeight))+,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF((float)(m_workingRect.Right-(-decYTHeight))-,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF(m_workingRect.Right--m_workingRect.Width/, m_workingRect.Bottom),
new PointF(m_workingRect.Left+m_workingRect.Width/, m_workingRect.Bottom),
};
pathYT.AddLines(psYT);
pathYT.CloseAllFigures();
rectYT = new Rectangle((m_workingRect.Left + ( - (int)decYTHeight)) + , m_workingRect.Bottom - (int)decYTHeight - , m_workingRect.Width - (int)( - decYTHeight) * - , );
}
else
{
PointF[] psYT = new PointF[]
{
new PointF(m_workingRect.Left,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF(m_workingRect.Right-,(float)(m_workingRect.Bottom-decYTHeight)),
new PointF(m_workingRect.Right-,m_workingRect.Bottom-),
new PointF(m_workingRect.Right--m_workingRect.Width/, m_workingRect.Bottom),
new PointF(m_workingRect.Left+m_workingRect.Width/, m_workingRect.Bottom),
new PointF(m_workingRect.Left,m_workingRect.Bottom-),
};
pathYT.AddLines(psYT);
pathYT.CloseAllFigures();
rectYT = new Rectangle(m_workingRect.Left, m_workingRect.Bottom - (int)decYTHeight - , m_workingRect.Width, );
} g.FillPath(new SolidBrush(liquidColor), pathYT);
g.FillPath(new SolidBrush(Color.FromArgb(, bottleMouthColor)), pathYT);
//画液体面
g.FillEllipse(new SolidBrush(liquidColor), rectYT);
g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), rectYT); //画高亮
int intCount = m_workingRect.Width / / ;
int intSplit = ( - ) / intCount;
for (int i = ; i < intCount; i++)
{
int _penWidth = m_workingRect.Width / - * i;
if (_penWidth <= )
_penWidth = ;
g.DrawLine(new Pen(new SolidBrush(Color.FromArgb(, Color.White)), _penWidth), new Point(m_workingRect.Width / , m_workingRect.Top), new Point(m_workingRect.Width / , m_workingRect.Bottom - ));
if (_penWidth == )
break;
} //画瓶底
g.FillEllipse(new SolidBrush(bottleColor), new RectangleF(m_workingRect.Left, m_workingRect.Top - , m_workingRect.Width - , ));
g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), new RectangleF(m_workingRect.Left, m_workingRect.Top - , m_workingRect.Width - , ));
//画瓶口
g.FillRectangle(new SolidBrush(bottleMouthColor), new Rectangle(m_workingRect.Left + m_workingRect.Width / , m_workingRect.Bottom, m_workingRect.Width / , ));
//画瓶颈阴影
GraphicsPath pathPJ = new GraphicsPath();
Point[] psPJ = new Point[]
{
new Point(m_workingRect.Left, m_workingRect.Bottom-),
new Point(m_workingRect.Right-, m_workingRect.Bottom-),
new Point(m_workingRect.Right--m_workingRect.Width/, m_workingRect.Bottom),
new Point(m_workingRect.Left+m_workingRect.Width/, m_workingRect.Bottom)
};
pathPJ.AddLines(psPJ);
pathPJ.CloseAllFigures();
g.FillPath(new SolidBrush(Color.FromArgb(, bottleMouthColor)), pathPJ); //写编号
if (!string.IsNullOrEmpty(m_NO))
{
var nosize = g.MeasureString(m_NO, Font);
g.DrawString(m_NO, Font, new SolidBrush(ForeColor), new PointF((this.Width - nosize.Width) / , m_workingRect.Top + ));
}
}
}
}

最后的话

如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星星吧

(五十六)c#Winform自定义控件-瓶子(工业)-HZHControls的更多相关文章

  1. (五十)c#Winform自定义控件-滑块

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  2. (八十)c#Winform自定义控件-分割线标签-HZHControls

    官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...

  3. (五十一)c#Winform自定义控件-文字提示-HZHControls

    官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...

  4. 【Visual C++】游戏开发五十六 浅墨DirectX教程二十三 打造游戏GUI界面(一)

    本系列文章由zhmxy555(毛星云)编写,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/16384009 作者:毛星云 ...

  5. 第三百五十六节,Python分布式爬虫打造搜索引擎Scrapy精讲—scrapy分布式爬虫要点

    第三百五十六节,Python分布式爬虫打造搜索引擎Scrapy精讲—scrapy分布式爬虫要点 1.分布式爬虫原理 2.分布式爬虫优点 3.分布式爬虫需要解决的问题

  6. “全栈2019”Java第五十六章:多态与字段详解

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...

  7. 《手把手教你》系列技巧篇(五十六)-java+ selenium自动化测试-下载文件-上篇(详细教程)

    1.简介 前边几篇文章讲解完如何上传文件,既然有上传,那么就可能会有下载文件.因此宏哥就接着讲解和分享一下:自动化测试下载文件.可能有的小伙伴或者童鞋们会觉得这不是很简单吗,还用你介绍和讲解啊,不说就 ...

  8. (三十)c#Winform自定义控件-文本框(三)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  9. Abp(net core)+easyui+efcore实现仓储管理系统——出库管理之七(五十六)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统--ABP总体介绍(一) abp(net core)+ ...

  10. (二十)c#Winform自定义控件-有后退的窗体

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

随机推荐

  1. 重载和重写的区别?构造器 Contructor 构造器是否可被 override?

    重载 发生在同一类,方法名必须相同,参数类型不同,顺序不同,类型不同,方法返回值和返回类型可以不同 重写 发生在子父类,方法名.参数名参数列表必须相同.返回值范围小于等于父类,抛出异常范围小于等于父类 ...

  2. 在.NET Core控制台中使用依赖注入

    本文介绍如何在控制台应用程序中使用微软提供的依赖注入功能,掌握控制台中的用法后,可以扩展到构建windows服务中. 创建控制台应用程序 添加DependencyInjection的引用 Instal ...

  3. 【每天一题】LeetCode 172. 阶乘后的零

    开源地址:点击该链接 题目描述 https://leetcode-cn.com/problems/factorial-trailing-zeroes 给定一个整数 n,返回 n! 结果尾数中零的数量. ...

  4. MESSAGE_TYPE_X dump in RSM_DATASTATE_CHECK -6-

    DTP抽数时系统Dump 参考sapnote:2398760 - MESSAGE_TYPE_X dump in RSM_DATASTATE_CHECK -1- to -12- RSM_DATASTAT ...

  5. Java面试题_第四阶段

    1.1 电商行业特点 1.分布式 垂直拆分:根据功能模块进行拆分 水平拆分:根据业务层级进行拆分 2.高并发 用户单位时间内访问服务器数量,是电商行业中面临的主要问题 3.集群 抗击高兵发的有效手段, ...

  6. 从零开始ant-design-vue-pro开发笔记(一)

    开始 从这里开始是用ant-design-vue组件写ant-design-vue-pro这个后台项目实现步骤的从零开始搭建的过程,视频地址,它采用了ant-desgin-vue的组件库作为素材开发, ...

  7. node error SOCKET error:10106

    上周我的node.js command prompt出错了,什么也干不了 SOCKET error:10106 纠结两天,终于搞定了,其实比较简单,就是不会弄起来好麻烦 参考: 作者:忆常  url: ...

  8. js-函数的三种创建方式

    1.声明式 function fn() { //do something } 2.函数表达式 let fn = function () { //do something } 3.构造函数 functi ...

  9. 44.QT-安装MySQL、测试连接MySQL

    在上章学习了42.QT-操作SQLite数据库后,发现MySQL和SQLite的语句都大致相同,所以本章只测试MySQL是否能使用 MySQL安装参考链接:https://blog.csdn.net/ ...

  10. JavaWeb 错误/异常时页面提示

    经常我们会遇到发生页面404错误,服务器 500 异常,如果默认方式处理,则是将异常捕获之后跳到 Tomcat 缺省的异常页面,如下图所示.