(八)c#Winform自定义控件-分割线
·
前提
入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。
官网:https://www.hzhcontrols.cn
GitHub:https://github.com/kwwwvagaa/NetWinformControl
如果觉得写的还行,请点个 star 支持一下吧
目录
c#Winform自定义控件-目录_c#winform自定义控件-有图标的按钮-CSDN博客
用处及效果
用处:区域分隔时使用
效果:


准备工作
其实就是1个横向的线和纵向的线,没有什么技术含量,至于为什么要等于呢,就是为了让效果统一,用起来方便
开始
横向的分割线
添加用户控件,命名UCSplitLine_H
全部代码如下
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCSplitLine_H.cs
// 创建日期:2019-08-15 16:03:21
// 功能描述:Split
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
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 UCSplitLine_H : UserControl
{
public UCSplitLine_H()
{
InitializeComponent();
this.TabStop = false;
}
}
}
namespace HZH_Controls.Controls
{
partial class UCSplitLine_H
{
/// <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();
//
// UCSplitLine_H
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.Name = "UCSplitLine_H";
this.Size = new System.Drawing.Size(100, 1);
this.ResumeLayout(false);
}
#endregion
}
}
最后的话
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)