(六十)c#Winform自定义控件-鼓风机(工业)
官网
前提
入行已经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+画的,不懂的可以自行百度一下
开始
添加2个枚举,分别控制进出风口的位置
- /// <summary>
- /// Enum BlowerEntranceDirection
- /// </summary>
- public enum BlowerEntranceDirection
- {
- /// <summary>
- /// The none
- /// </summary>
- None,
- /// <summary>
- /// The left
- /// </summary>
- Left,
- /// <summary>
- /// The right
- /// </summary>
- Right,
- /// <summary>
- /// Up
- /// </summary>
- Up
- }
- /// <summary>
- /// Enum BlowerExitDirection
- /// </summary>
- public enum BlowerExitDirection
- {
- /// <summary>
- /// The left
- /// </summary>
- Left,
- /// <summary>
- /// The right
- /// </summary>
- Right,
- /// <summary>
- /// Up
- /// </summary>
- Up
- }
属性
- /// <summary>
- /// The entrance direction
- /// </summary>
- private BlowerEntranceDirection entranceDirection = BlowerEntranceDirection.None;
- /// <summary>
- /// Gets or sets the entrance direction.
- /// </summary>
- /// <value>The entrance direction.</value>
- [Description("入口方向"), Category("自定义")]
- public BlowerEntranceDirection EntranceDirection
- {
- get { return entranceDirection; }
- set
- {
- entranceDirection = value;
- Refresh();
- }
- }
- /// <summary>
- /// The exit direction
- /// </summary>
- private BlowerExitDirection exitDirection = BlowerExitDirection.Right;
- /// <summary>
- /// Gets or sets the exit direction.
- /// </summary>
- /// <value>The exit direction.</value>
- [Description("出口方向"), Category("自定义")]
- public BlowerExitDirection ExitDirection
- {
- get { return exitDirection; }
- set
- {
- exitDirection = value;
- Refresh();
- }
- }
- /// <summary>
- /// The blower color
- /// </summary>
- private Color blowerColor = Color.FromArgb(, , );
- /// <summary>
- /// Gets or sets the color of the blower.
- /// </summary>
- /// <value>The color of the blower.</value>
- [Description("风机颜色"), Category("自定义")]
- public Color BlowerColor
- {
- get { return blowerColor; }
- set
- {
- blowerColor = value;
- Refresh();
- }
- }
- /// <summary>
- /// The fan color
- /// </summary>
- private Color fanColor = Color.FromArgb(, , );
- /// <summary>
- /// Gets or sets the color of the fan.
- /// </summary>
- /// <value>The color of the fan.</value>
- [Description("风叶颜色"), Category("自定义")]
- public Color FanColor
- {
- get { return fanColor; }
- set
- {
- fanColor = value;
- Refresh();
- }
- }
- /// <summary>
- /// The m rect working
- /// </summary>
- Rectangle m_rectWorking;
重绘
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- var g = e.Graphics;
- g.SetGDIHigh();
- GraphicsPath pathLineIn = new GraphicsPath();
- GraphicsPath pathLineOut = new GraphicsPath();
- int intLinePenWidth = ;
- switch (exitDirection)
- {
- case BlowerExitDirection.Left:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(, m_rectWorking.Top, this.Width / , m_rectWorking.Height / - ));
- intLinePenWidth = m_rectWorking.Height / - ;
- pathLineOut.AddLine(new Point(-, m_rectWorking.Top + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Top + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(, m_rectWorking.Top - ), new Point(, m_rectWorking.Top + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerExitDirection.Right:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(this.Width / , m_rectWorking.Top, this.Width / , m_rectWorking.Height / - ));
- intLinePenWidth = m_rectWorking.Height / - ;
- pathLineOut.AddLine(new Point(this.Width + , m_rectWorking.Top + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Top + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(this.Width - , m_rectWorking.Top - ), new Point(this.Width - , m_rectWorking.Top + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerExitDirection.Up:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(m_rectWorking.Right - (m_rectWorking.Width / - ), , m_rectWorking.Width / - , this.Height / ));
- intLinePenWidth = m_rectWorking.Width / - ;
- pathLineOut.AddLine(new Point(m_rectWorking.Right - (m_rectWorking.Width / - ) / , -), new Point(m_rectWorking.Right - (m_rectWorking.Width / - ) / , m_rectWorking.Top + m_rectWorking.Height / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(m_rectWorking.Right + , ), new Point(m_rectWorking.Right - (m_rectWorking.Width / - ) - , ));
- break;
- }
- switch (entranceDirection)
- {
- case BlowerEntranceDirection.Left:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(, m_rectWorking.Bottom - m_rectWorking.Height / + , this.Width / , m_rectWorking.Height / - ));
- pathLineIn.AddLine(new Point(-, m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(, m_rectWorking.Bottom - m_rectWorking.Height / + - ), new Point(, m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerEntranceDirection.Right:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(this.Width / , m_rectWorking.Bottom - m_rectWorking.Height / + , this.Width / , m_rectWorking.Height / - ));
- pathLineIn.AddLine(new Point(this.Width + , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(this.Width - , m_rectWorking.Bottom - m_rectWorking.Height / + - ), new Point(this.Width - , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerEntranceDirection.Up:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(m_rectWorking.Left, , m_rectWorking.Width / - , this.Height / ));
- pathLineIn.AddLine(new Point(m_rectWorking.Left + (m_rectWorking.Width / - ) / , -), new Point(m_rectWorking.Left + (m_rectWorking.Width / - ) / , m_rectWorking.Top + m_rectWorking.Height / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(m_rectWorking.Left - , ), new Point(m_rectWorking.Left + (m_rectWorking.Width / - ) + , ));
- break;
- }
- //渐变色
- int _intPenWidth = intLinePenWidth;
- int intCount = _intPenWidth / / ;
- for (int i = ; i < intCount; i++)
- {
- int _penWidth = _intPenWidth / - * i;
- if (_penWidth <= )
- _penWidth = ;
- if (entranceDirection != BlowerEntranceDirection.None)
- g.DrawPath(new Pen(new SolidBrush(Color.FromArgb(, Color.White.R, Color.White.G, Color.White.B)), _penWidth), pathLineIn);
- g.DrawPath(new Pen(new SolidBrush(Color.FromArgb(, Color.White.R, Color.White.G, Color.White.B)), _penWidth), pathLineOut);
- if (_penWidth == )
- break;
- }
- //底座
- GraphicsPath gpDZ = new GraphicsPath();
- gpDZ.AddLines(new Point[]
- {
- new Point( m_rectWorking.Left+m_rectWorking.Width/,m_rectWorking.Top+m_rectWorking.Height/),
- new Point(m_rectWorking.Left+,this.Height),
- new Point(m_rectWorking.Right-,this.Height)
- });
- gpDZ.CloseAllFigures();
- g.FillPath(new SolidBrush(blowerColor), gpDZ);
- g.FillPath(new SolidBrush(Color.FromArgb(, Color.White)), gpDZ);
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(m_rectWorking.Left, this.Height - ), new Point(m_rectWorking.Right, this.Height - ));
- //中心
- g.FillEllipse(new SolidBrush(blowerColor), m_rectWorking);
- g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), m_rectWorking);
- //扇叶
- Rectangle _rect = new Rectangle(m_rectWorking.Left + (m_rectWorking.Width - (m_rectWorking.Width / * )) / , m_rectWorking.Top + (m_rectWorking.Height - (m_rectWorking.Width / * )) / , (m_rectWorking.Width / * ), (m_rectWorking.Width / * ));
- int _splitCount = ;
- float fltSplitValue = 360F / (float)_splitCount;
- for (int i = ; i <= _splitCount; i++)
- {
- float fltAngle = (fltSplitValue * i - ) % ;
- float fltY1 = (float)(_rect.Top + _rect.Width / - ((_rect.Width / ) * Math.Sin(Math.PI * (fltAngle / 180.00F))));
- float fltX1 = (float)(_rect.Left + (_rect.Width / - ((_rect.Width / ) * Math.Cos(Math.PI * (fltAngle / 180.00F)))));
- float fltY2 = ;
- float fltX2 = ;
- fltY2 = (float)(_rect.Top + _rect.Width / - ((_rect.Width / ) * Math.Sin(Math.PI * (fltAngle / 180.00F))));
- fltX2 = (float)(_rect.Left + (_rect.Width / - ((_rect.Width / ) * Math.Cos(Math.PI * (fltAngle / 180.00F)))));
- g.DrawLine(new Pen(new SolidBrush(fanColor), ), new PointF(fltX1, fltY1), new PointF(fltX2, fltY2));
- }
- g.FillEllipse(new SolidBrush(fanColor), new Rectangle(_rect.Left + _rect.Width / - _rect.Width / + , _rect.Top + _rect.Width / - _rect.Width / + , _rect.Width / - , _rect.Width / - ));
- g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), new Rectangle(_rect.Left - , _rect.Top - , _rect.Width + , _rect.Height + ));
- }
全部代码
- // ***********************************************************************
- // Assembly : HZH_Controls
- // Created : 2019-09-09
- //
- // ***********************************************************************
- // <copyright file="UCBlower.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 UCBlower.
- /// Implements the <see cref="System.Windows.Forms.UserControl" />
- /// </summary>
- /// <seealso cref="System.Windows.Forms.UserControl" />
- public class UCBlower : UserControl
- {
- /// <summary>
- /// The entrance direction
- /// </summary>
- private BlowerEntranceDirection entranceDirection = BlowerEntranceDirection.None;
- /// <summary>
- /// Gets or sets the entrance direction.
- /// </summary>
- /// <value>The entrance direction.</value>
- [Description("入口方向"), Category("自定义")]
- public BlowerEntranceDirection EntranceDirection
- {
- get { return entranceDirection; }
- set
- {
- entranceDirection = value;
- Refresh();
- }
- }
- /// <summary>
- /// The exit direction
- /// </summary>
- private BlowerExitDirection exitDirection = BlowerExitDirection.Right;
- /// <summary>
- /// Gets or sets the exit direction.
- /// </summary>
- /// <value>The exit direction.</value>
- [Description("出口方向"), Category("自定义")]
- public BlowerExitDirection ExitDirection
- {
- get { return exitDirection; }
- set
- {
- exitDirection = value;
- Refresh();
- }
- }
- /// <summary>
- /// The blower color
- /// </summary>
- private Color blowerColor = Color.FromArgb(, , );
- /// <summary>
- /// Gets or sets the color of the blower.
- /// </summary>
- /// <value>The color of the blower.</value>
- [Description("风机颜色"), Category("自定义")]
- public Color BlowerColor
- {
- get { return blowerColor; }
- set
- {
- blowerColor = value;
- Refresh();
- }
- }
- /// <summary>
- /// The fan color
- /// </summary>
- private Color fanColor = Color.FromArgb(, , );
- /// <summary>
- /// Gets or sets the color of the fan.
- /// </summary>
- /// <value>The color of the fan.</value>
- [Description("风叶颜色"), Category("自定义")]
- public Color FanColor
- {
- get { return fanColor; }
- set
- {
- fanColor = value;
- Refresh();
- }
- }
- /// <summary>
- /// The m rect working
- /// </summary>
- Rectangle m_rectWorking;
- /// <summary>
- /// Initializes a new instance of the <see cref="UCBlower"/> class.
- /// </summary>
- public UCBlower()
- {
- 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 += UCBlower_SizeChanged;
- this.Size = new Size(, );
- }
- /// <summary>
- /// Handles the SizeChanged event of the UCBlower 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 UCBlower_SizeChanged(object sender, EventArgs e)
- {
- int intMin = Math.Min(this.Width, this.Height);
- m_rectWorking = new Rectangle((this.Width - (intMin / * )) / , (this.Height - (intMin / * )) / , (intMin / * ), (intMin / * ));
- }
- /// <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();
- GraphicsPath pathLineIn = new GraphicsPath();
- GraphicsPath pathLineOut = new GraphicsPath();
- int intLinePenWidth = ;
- switch (exitDirection)
- {
- case BlowerExitDirection.Left:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(, m_rectWorking.Top, this.Width / , m_rectWorking.Height / - ));
- intLinePenWidth = m_rectWorking.Height / - ;
- pathLineOut.AddLine(new Point(-, m_rectWorking.Top + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Top + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(, m_rectWorking.Top - ), new Point(, m_rectWorking.Top + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerExitDirection.Right:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(this.Width / , m_rectWorking.Top, this.Width / , m_rectWorking.Height / - ));
- intLinePenWidth = m_rectWorking.Height / - ;
- pathLineOut.AddLine(new Point(this.Width + , m_rectWorking.Top + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Top + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(this.Width - , m_rectWorking.Top - ), new Point(this.Width - , m_rectWorking.Top + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerExitDirection.Up:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(m_rectWorking.Right - (m_rectWorking.Width / - ), , m_rectWorking.Width / - , this.Height / ));
- intLinePenWidth = m_rectWorking.Width / - ;
- pathLineOut.AddLine(new Point(m_rectWorking.Right - (m_rectWorking.Width / - ) / , -), new Point(m_rectWorking.Right - (m_rectWorking.Width / - ) / , m_rectWorking.Top + m_rectWorking.Height / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(m_rectWorking.Right + , ), new Point(m_rectWorking.Right - (m_rectWorking.Width / - ) - , ));
- break;
- }
- switch (entranceDirection)
- {
- case BlowerEntranceDirection.Left:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(, m_rectWorking.Bottom - m_rectWorking.Height / + , this.Width / , m_rectWorking.Height / - ));
- pathLineIn.AddLine(new Point(-, m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(, m_rectWorking.Bottom - m_rectWorking.Height / + - ), new Point(, m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerEntranceDirection.Right:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(this.Width / , m_rectWorking.Bottom - m_rectWorking.Height / + , this.Width / , m_rectWorking.Height / - ));
- pathLineIn.AddLine(new Point(this.Width + , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ), new Point(m_rectWorking.Left + m_rectWorking.Width / , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(this.Width - , m_rectWorking.Bottom - m_rectWorking.Height / + - ), new Point(this.Width - , m_rectWorking.Bottom - m_rectWorking.Height / + + (m_rectWorking.Height / - ) + ));
- break;
- case BlowerEntranceDirection.Up:
- g.FillRectangle(new SolidBrush(blowerColor), new Rectangle(m_rectWorking.Left, , m_rectWorking.Width / - , this.Height / ));
- pathLineIn.AddLine(new Point(m_rectWorking.Left + (m_rectWorking.Width / - ) / , -), new Point(m_rectWorking.Left + (m_rectWorking.Width / - ) / , m_rectWorking.Top + m_rectWorking.Height / ));
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(m_rectWorking.Left - , ), new Point(m_rectWorking.Left + (m_rectWorking.Width / - ) + , ));
- break;
- }
- //渐变色
- int _intPenWidth = intLinePenWidth;
- int intCount = _intPenWidth / / ;
- for (int i = ; i < intCount; i++)
- {
- int _penWidth = _intPenWidth / - * i;
- if (_penWidth <= )
- _penWidth = ;
- if (entranceDirection != BlowerEntranceDirection.None)
- g.DrawPath(new Pen(new SolidBrush(Color.FromArgb(, Color.White.R, Color.White.G, Color.White.B)), _penWidth), pathLineIn);
- g.DrawPath(new Pen(new SolidBrush(Color.FromArgb(, Color.White.R, Color.White.G, Color.White.B)), _penWidth), pathLineOut);
- if (_penWidth == )
- break;
- }
- //底座
- GraphicsPath gpDZ = new GraphicsPath();
- gpDZ.AddLines(new Point[]
- {
- new Point( m_rectWorking.Left+m_rectWorking.Width/,m_rectWorking.Top+m_rectWorking.Height/),
- new Point(m_rectWorking.Left+,this.Height),
- new Point(m_rectWorking.Right-,this.Height)
- });
- gpDZ.CloseAllFigures();
- g.FillPath(new SolidBrush(blowerColor), gpDZ);
- g.FillPath(new SolidBrush(Color.FromArgb(, Color.White)), gpDZ);
- g.DrawLine(new Pen(new SolidBrush(blowerColor), ), new Point(m_rectWorking.Left, this.Height - ), new Point(m_rectWorking.Right, this.Height - ));
- //中心
- g.FillEllipse(new SolidBrush(blowerColor), m_rectWorking);
- g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), m_rectWorking);
- //扇叶
- Rectangle _rect = new Rectangle(m_rectWorking.Left + (m_rectWorking.Width - (m_rectWorking.Width / * )) / , m_rectWorking.Top + (m_rectWorking.Height - (m_rectWorking.Width / * )) / , (m_rectWorking.Width / * ), (m_rectWorking.Width / * ));
- int _splitCount = ;
- float fltSplitValue = 360F / (float)_splitCount;
- for (int i = ; i <= _splitCount; i++)
- {
- float fltAngle = (fltSplitValue * i - ) % ;
- float fltY1 = (float)(_rect.Top + _rect.Width / - ((_rect.Width / ) * Math.Sin(Math.PI * (fltAngle / 180.00F))));
- float fltX1 = (float)(_rect.Left + (_rect.Width / - ((_rect.Width / ) * Math.Cos(Math.PI * (fltAngle / 180.00F)))));
- float fltY2 = ;
- float fltX2 = ;
- fltY2 = (float)(_rect.Top + _rect.Width / - ((_rect.Width / ) * Math.Sin(Math.PI * (fltAngle / 180.00F))));
- fltX2 = (float)(_rect.Left + (_rect.Width / - ((_rect.Width / ) * Math.Cos(Math.PI * (fltAngle / 180.00F)))));
- g.DrawLine(new Pen(new SolidBrush(fanColor), ), new PointF(fltX1, fltY1), new PointF(fltX2, fltY2));
- }
- g.FillEllipse(new SolidBrush(fanColor), new Rectangle(_rect.Left + _rect.Width / - _rect.Width / + , _rect.Top + _rect.Width / - _rect.Width / + , _rect.Width / - , _rect.Width / - ));
- g.FillEllipse(new SolidBrush(Color.FromArgb(, Color.White)), new Rectangle(_rect.Left - , _rect.Top - , _rect.Width + , _rect.Height + ));
- }
- }
- /// <summary>
- /// Enum BlowerEntranceDirection
- /// </summary>
- public enum BlowerEntranceDirection
- {
- /// <summary>
- /// The none
- /// </summary>
- None,
- /// <summary>
- /// The left
- /// </summary>
- Left,
- /// <summary>
- /// The right
- /// </summary>
- Right,
- /// <summary>
- /// Up
- /// </summary>
- Up
- }
- /// <summary>
- /// Enum BlowerExitDirection
- /// </summary>
- public enum BlowerExitDirection
- {
- /// <summary>
- /// The left
- /// </summary>
- Left,
- /// <summary>
- /// The right
- /// </summary>
- Right,
- /// <summary>
- /// Up
- /// </summary>
- Up
- }
- }
添加一个类UCBlower ,继承UserControl
最后的话
如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星星吧
(六十)c#Winform自定义控件-鼓风机(工业)的更多相关文章
- (二十六)c#Winform自定义控件-有确定取消的窗体(二)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- (八十六)c#Winform自定义控件-表格优化
出处:http://www.hzhcontrols.com/原文:http://www.hzhcontrols.com/blog-149.html本文版权归www.hzhcontrols.com所有欢 ...
- (四十六)c#Winform自定义控件-水波进度条-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- (十六)c#Winform自定义控件-文本框哪里去了?-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- (五十六)c#Winform自定义控件-瓶子(工业)-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- (七十六)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 ...
- (六)c#Winform自定义控件-单选框
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- winform 自定义控件(高手)
高手推荐:https://www.cnblogs.com/bfyx/p/11364884.html c#Winform自定义控件-目录 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件 ...
随机推荐
- WPF:事件委托对于不同界面间通信的应用
界面1内设定点击事件,生成Path用事件传出public partial class TemplateWindow : Window { internal delegate v ...
- window下打jar包
比如我的项目在 F/Myjar F:\Myjar>ll'll' 不是内部或外部命令,也不是可运行的程序或批处理文件. F:\Myjar>cd mian系统找不到指定的路径. F:\Myja ...
- 二叉查找树(查找、插入、删除)——C语言
二叉查找树 二叉查找树(BST:Binary Search Tree)是一种特殊的二叉树,它改善了二叉树节点查找的效率.二叉查找树有以下性质: (1)若左子树不空,则左子树上所有节点的值均小于它的根节 ...
- 数据结构之最小堆的实现C++版
完全二叉树之所以用数组的方式存在,在于他的一个特性 若子节点为i,则父节点为(i-1)/2,注意c++特性,该结果肯定是个整数. 若父节点为j,则子节点必为2*j+1;则在数组里面可以非常方便的通过下 ...
- Visual Studio Debug
在watch窗口输入,$err,hr可以看到上一个错误代码和相关描述信息 Error Lookup可以将错误代码转换成为相应的文本描述 FormatMessage()
- linux学习总结--linux100day(day2)
Linux中的哲学--一切皆文件 为了便于操作,我们可以使用secureCRT或Xshell连接到我们的虚拟机. 要用远程工具连接到虚拟机上,我们只需要打开虚拟机上的ssh服务,在xshell中填写主 ...
- Java8 CompletableFuture 编程
一.简介 所谓异步调用其实就是实现一个无需等待被调用函数的返回值而让操作继续运行的方法.在 Java 语言中,简单的讲就是另启一个线程来完成调用中的部分计算,使调用继续运行或返回,而不需要等待计算结 ...
- 分布式存储——ceph 的 python 基础接口
python 使用 boto 库完成分布式存储读.写.判断接口 import boto import boto.s3.connection from boto.s3.key import Key im ...
- Python+Selenium - Web自动化测试(一):环境搭建
清单列表: Python 3x Selenium Chrome Pycharm 一.Python的安装: Python官网下载地址:https://www.python.org/ 1. 进入官网地址 ...
- 用 Python 分析上网记录,发现了很多不可思议的事
摘要:分享个 Python 神工具. 长时间使用浏览器会积累大量浏览器历史记录,这些是很隐私的数据,里面甚至可能有一些不可描述的网站或者搜索记录不想让别人知道. 不过,我们自己可能会感兴趣,天天上 ...