Commit 2b38a600 HZH

折叠面板

1 个父辈 a8baef6b
......@@ -36,12 +36,14 @@
this.lblTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232)))));
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.lblTitle.ForeColor = System.Drawing.Color.White;
this.lblTitle.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblTitle.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(253, 34);
this.lblTitle.TabIndex = 0;
this.lblTitle.Text = "面板";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lblTitle_MouseDown);
//
// UCPanelTitle
//
......@@ -55,6 +57,7 @@
this.Name = "UCPanelTitle";
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(119)))), ((int)(((byte)(232)))));
this.Size = new System.Drawing.Size(253, 171);
this.SizeChanged += new System.EventHandler(this.UCPanelTitle_SizeChanged);
this.ResumeLayout(false);
}
......
......@@ -6,11 +6,55 @@ using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace HZH_Controls.Controls
{
public partial class UCPanelTitle : UCControlBase
{
private int m_intMaxHeight = 0;
private bool isCanExpand = true;
[Description("是否可折叠"), Category("自定义")]
public bool IsCanExpand
{
get { return isCanExpand; }
set
{
isCanExpand = value;
if (value)
{
lblTitle.Image = GetImg();
}
else
{
lblTitle.Image = null;
}
}
}
private bool isExpand = false;
[Description("是否已折叠"), Category("自定义")]
public bool IsExpand
{
get { return isExpand; }
set
{
isExpand = value;
if (value)
{
m_intMaxHeight = this.Height;
this.Height = lblTitle.Height;
}
else
{
this.Height = m_intMaxHeight;
}
lblTitle.Image = GetImg();
}
}
[Description("边框颜色"), Category("自定义")]
public Color BorderColor
{
......@@ -28,9 +72,93 @@ namespace HZH_Controls.Controls
get { return lblTitle.Text; }
set { lblTitle.Text = value; }
}
public override Color ForeColor
{
get
{
return this.lblTitle.ForeColor;
}
set
{
this.lblTitle.ForeColor = value;
GetImg(true);
if (isCanExpand)
{
lblTitle.Image = GetImg();
}
else
{
lblTitle.Image = null;
}
}
}
public UCPanelTitle()
{
InitializeComponent();
if (isCanExpand)
{
lblTitle.Image = GetImg();
}
else
{
lblTitle.Image = null;
}
}
Bitmap bitDown = null;
Bitmap bitUp = null;
private Bitmap GetImg(bool blnRefresh = false)
{
if (isExpand)
{
if (bitDown == null || blnRefresh)
{
bitDown = new Bitmap(24, 24);
Graphics g = Graphics.FromImage(bitDown);
g.SetGDIHigh();
GraphicsPath path = new GraphicsPath();
path.AddLine(3, 5, 21, 5);
path.AddLine(21, 5, 12, 19);
path.AddLine(12, 19, 3, 5);
g.FillPath(new SolidBrush(ForeColor), path);
g.Dispose();
}
return bitDown;
}
else
{
if (bitUp == null || blnRefresh)
{
bitUp = new Bitmap(24, 24);
Graphics g = Graphics.FromImage(bitUp);
g.SetGDIHigh();
GraphicsPath path = new GraphicsPath();
path.AddLine(3, 19, 21, 19);
path.AddLine(21, 19, 12, 5);
path.AddLine(12, 5, 3, 19);
g.FillPath(new SolidBrush(ForeColor), path);
g.Dispose();
}
return bitUp;
}
}
private void lblTitle_MouseDown(object sender, MouseEventArgs e)
{
if (isCanExpand)
{
IsExpand = !IsExpand;
}
}
private void UCPanelTitle_SizeChanged(object sender, EventArgs e)
{
if (this.Height != lblTitle.Height)
{
m_intMaxHeight = this.Height;
}
}
}
}
......@@ -69,7 +69,7 @@
this.btnBack1.BtnBackColor = System.Drawing.Color.Transparent;
this.btnBack1.BtnFont = new System.Drawing.Font("微软雅黑", 17F);
this.btnBack1.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.btnBack1.BtnText = "自定义按钮";
this.btnBack1.BtnText = " 自定义按钮";
this.btnBack1.ConerRadius = 5;
this.btnBack1.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnBack1.Dock = System.Windows.Forms.DockStyle.Left;
......@@ -77,6 +77,7 @@
this.btnBack1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.btnBack1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.btnBack1.Image = ((System.Drawing.Image)(resources.GetObject("btnBack1.Image")));
this.btnBack1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnBack1.IsRadius = true;
this.btnBack1.IsShowRect = true;
this.btnBack1.IsShowTips = false;
......@@ -88,6 +89,7 @@
this.btnBack1.Size = new System.Drawing.Size(200, 60);
this.btnBack1.TabIndex = 0;
this.btnBack1.TabStop = false;
this.btnBack1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnBack1.TipsText = "";
this.btnBack1.BtnClick += new System.EventHandler(this.btnBack1_btnClick);
//
......@@ -108,7 +110,7 @@
this.ucSplitLine_H1.TabIndex = 0;
this.ucSplitLine_H1.TabStop = false;
//
// FrmTemp1
// FrmBack
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
......@@ -116,7 +118,7 @@
this.Controls.Add(this.ucSplitLine_H1);
this.Controls.Add(this.panTop);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmTemp1";
this.Name = "FrmBack";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "FrmTemp1";
......
......@@ -121,7 +121,7 @@
<data name="btnBack1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABnSURBVDhPYyAV/IcCKJc48Pz5tf//AwLAGCpEGPw/cwau
YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAABnSURBVDhPYyAV/IcCKJc48Pz5tf//AwLAGCpEGPw/cwau
iWiN6Jr+p6UR1jjYNc2cSQVNQD5UCjcY5JpAgCxNIICiEYRJScSDRzMoK0GlCINRzUAMzHJQKcIAlLWQ
NUOFiQMIzQH/AUt/OaDjNm1jAAAAAElFTkSuQmCC
</value>
......@@ -134,7 +134,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAE
CgAAAk1TRnQBSQFMAwEBAAHAAQABwAEAAR4BAAEeAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
CgAAAk1TRnQBSQFMAwEBAAHIAQAByAEAAR4BAAEeAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AXgDAAEeAwABAQEAAQgFAAEQAQ4YAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
......
......@@ -59,7 +59,6 @@
this.ucPanelTitle1 = new HZH_Controls.Controls.UCPanelTitle();
this.ucStep2 = new HZH_Controls.Controls.UCStep();
this.ucStep1 = new HZH_Controls.Controls.UCStep();
this.ucBtnImg1 = new HZH_Controls.Controls.UCBtnImg();
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
......@@ -142,7 +141,7 @@
this.ucProcessWave2.ConerRadius = 0;
this.ucProcessWave2.FillColor = System.Drawing.Color.Empty;
this.ucProcessWave2.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucProcessWave2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ucProcessWave2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucProcessWave2.IsRadius = false;
this.ucProcessWave2.IsRectangle = false;
this.ucProcessWave2.IsShowRect = true;
......@@ -163,7 +162,7 @@
this.ucProcessWave1.ConerRadius = 0;
this.ucProcessWave1.FillColor = System.Drawing.Color.Empty;
this.ucProcessWave1.Font = new System.Drawing.Font("微软雅黑", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucProcessWave1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ucProcessWave1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucProcessWave1.IsRadius = false;
this.ucProcessWave1.IsRectangle = true;
this.ucProcessWave1.IsShowRect = true;
......@@ -436,6 +435,8 @@
this.ucPanelTitle1.ConerRadius = 10;
this.ucPanelTitle1.FillColor = System.Drawing.Color.White;
this.ucPanelTitle1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucPanelTitle1.IsCanExpand = true;
this.ucPanelTitle1.IsExpand = false;
this.ucPanelTitle1.IsRadius = true;
this.ucPanelTitle1.IsShowRect = true;
this.ucPanelTitle1.Location = new System.Drawing.Point(406, 14);
......@@ -491,40 +492,11 @@
this.ucStep1.StepWidth = 35;
this.ucStep1.TabIndex = 0;
//
// ucBtnImg1
//
this.ucBtnImg1.BackColor = System.Drawing.Color.White;
this.ucBtnImg1.BtnBackColor = System.Drawing.Color.White;
this.ucBtnImg1.BtnFont = new System.Drawing.Font("微软雅黑", 17F);
this.ucBtnImg1.BtnForeColor = System.Drawing.Color.White;
this.ucBtnImg1.BtnText = "自定义按钮";
this.ucBtnImg1.ConerRadius = 5;
this.ucBtnImg1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnImg1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnImg1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnImg1.ForeColor = System.Drawing.Color.White;
this.ucBtnImg1.Image = ((System.Drawing.Image)(resources.GetObject("ucBtnImg1.Image")));
this.ucBtnImg1.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.ucBtnImg1.IsRadius = true;
this.ucBtnImg1.IsShowRect = true;
this.ucBtnImg1.IsShowTips = false;
this.ucBtnImg1.Location = new System.Drawing.Point(1016, 263);
this.ucBtnImg1.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnImg1.Name = "ucBtnImg1";
this.ucBtnImg1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnImg1.RectWidth = 1;
this.ucBtnImg1.Size = new System.Drawing.Size(184, 108);
this.ucBtnImg1.TabIndex = 12;
this.ucBtnImg1.TabStop = false;
this.ucBtnImg1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.ucBtnImg1.TipsText = "";
//
// Form2
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1438, 594);
this.Controls.Add(this.ucBtnImg1);
this.Controls.Add(this.ucProcessWave2);
this.Controls.Add(this.ucProcessWave1);
this.Controls.Add(this.ucWaveWithSource1);
......@@ -595,7 +567,6 @@
private HZH_Controls.Controls.UCWaveWithSource ucWaveWithSource1;
private HZH_Controls.Controls.UCProcessWave ucProcessWave1;
private HZH_Controls.Controls.UCProcessWave ucProcessWave2;
private HZH_Controls.Controls.UCBtnImg ucBtnImg1;
}
}
\ No newline at end of file
......@@ -130,14 +130,4 @@
b1p1tZEYIvwEAAAAAElFTkSuQmCC
</value>
</data>
<data name="ucBtnImg1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADKSURBVDhPxZSxDcMgEEWZlhXYgB2uc5FBqNJA7RUs0URM
QPyJCWATfI4i5UtfQqd7B9/YFllxFUkZo6Oht/YiQBxwWeYW5oKP+V5A732EOaAxpoDI54jYYAihwNyj
skClVHJdO82otU7QNN0auAGh/Y5oRhNcg6dHZYFYoMAFoQT2MqJZrku4BjEoQVn7o8IZJHLvGnbckJd6
IKZba5vaIeOVV+4rkJWx59+Avev45Aa88ln9OSMECNcyMp7DAcQ0/MFGBoQBQgjxBE7XkBduYXLWAAAA
AElFTkSuQmCC
</value>
</data>
</root>
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!