当前路径:Cool.Windows.Forms/CoolForm.cs using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Cool.Windows.Forms { public class CoolForm : Form { private Size NormalSize = new Size(320, 240); private Panel TopBorderBar; private Panel BottomBorderBar; private Panel RightBorderBar; private Panel LeftBorderBar; private int borderBarWidth = 2; private Rectangle TopBorderRect; private Rectangle BottomBorderRect; private Rectangle RightBorderRect; private Rectangle LeftBorderRect; private MouseMoveStatus leftMouseMove = default(MouseMoveStatus); private MouseMoveStatus topMouseMove = default(MouseMoveStatus); private MouseMoveStatus rightMouseMove = default(MouseMoveStatus); private MouseMoveStatus bottomMouseMove = default(MouseMoveStatus); private bool leftMouseDown = false; private bool topMouseDown = false; private bool rightMouseDown = false; private bool bottomMouseDown = false; public CoolForm() { InitializeComponent(); LeftBorderRect = new Rectangle(0, 0, borderBarWidth, LeftBorderBar.Height); TopBorderRect = new Rectangle(0, 0, TopBorderBar.Width, borderBarWidth); RightBorderRect = new Rectangle(RightBorderBar.Width - borderBarWidth, 0, borderBarWidth, RightBorderBar.Height); BottomBorderRect = new Rectangle(0, BottomBorderBar.Height - borderBarWidth, BottomBorderBar.Width, borderBarWidth); } private Color _borderColor = Color.FromArgb(0, 163, 129); [System.ComponentModel.Browsable(true)] [System.ComponentModel.DefaultValue(typeof(Color), "Color.FromArgb(0, 163, 129)")] public Color BorderColor { get => _borderColor; set { _borderColor = value; TopBorderBar.BackColor = _borderColor; BottomBorderBar.BackColor = _borderColor; RightBorderBar.BackColor = _borderColor; LeftBorderBar.BackColor = _borderColor; } } private bool _isBorder = true; [System.ComponentModel.Browsable(true)] [System.ComponentModel.DefaultValue(typeof(bool), "true")] public bool IsBorder { get => _isBorder; set { _isBorder = value; LeftBorderBar.Visible = _isBorder; TopBorderBar.Visible = _isBorder; RightBorderBar.Visible = _isBorder; BottomBorderBar.Visible = _isBorder; } } //是否可以拖动窗体来改变大小 private bool _isDragging = true; [System.ComponentModel.Browsable(true)] [System.ComponentModel.DefaultValue(typeof(bool), "true")] public bool IsDragging { get => _isDragging; set { _isDragging = value; } } private void InitializeComponent() { this.LeftBorderBar = new System.Windows.Forms.Pane...
完整源码文件,请先购买后再查看
相关源码
- 服装管理信息系统2023-06-01
- WPS EXCEL 嵌入 WINFORM2023-05-15
- 仓库管理系统2023-05-14
- WPF基础权限系统2023-05-07
- 资料管理器2023-04-12
- 信呼协同办公OA系统 V2.5.12023-02-08
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2023. 京ICP备09089570号 | 京公网安备11010702000869号
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2023. 京ICP备09089570号 | 京公网安备11010702000869号