功能调整
This commit is contained in:
1 parent
42acf1b1cb
commit
772d9f4780
40 files changed
+4953
-389
No files matched your search
@@ -236,12 +236,6 @@
|
||||
<DependentUpon>MyProSkuItemsControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyControl\TextAndImageColumn.cs" />
|
||||
<Compile Include="MyControl\UcCheckBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MyControl\UcCheckBox.Designer.cs">
|
||||
<DependentUpon>UcCheckBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyControl\UcPager.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
||||
Generated
+2
-2
@@ -54,7 +54,7 @@ namespace _29WxOrder
|
||||
this.pnlAfterSale = new DevComponents.DotNetBar.PanelEx();
|
||||
this.pnlOrderManage = new DevComponents.DotNetBar.PanelEx();
|
||||
this.splitMain = new System.Windows.Forms.SplitContainer();
|
||||
this.chkHasLogisticsThenSend = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.chkHasLogisticsThenSend = new Work.UserComponents.UcCheckBox(this.components);
|
||||
this.btn电子面单测试 = new System.Windows.Forms.Button();
|
||||
this.btnExportExcel = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnSetMutliBuyer = new DevComponents.DotNetBar.PanelEx();
|
||||
@@ -1783,7 +1783,7 @@ namespace _29WxOrder
|
||||
private DevComponents.DotNetBar.Controls.CheckBoxX chkUseMultiBuyer;
|
||||
private DevComponents.DotNetBar.PanelEx btnSetMutliBuyer;
|
||||
private System.Windows.Forms.Button btn电子面单测试;
|
||||
private TemuKJD.UserComponent.UcCheckBox chkHasLogisticsThenSend;
|
||||
private Work.UserComponents.UcCheckBox chkHasLogisticsThenSend;
|
||||
}
|
||||
}
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
|
||||
namespace TemuKJD.UserComponent
|
||||
{
|
||||
partial class UcCheckBox
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
using AllBase.Helper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace TemuKJD.UserComponent
|
||||
{
|
||||
public partial class UcCheckBox : CheckBox
|
||||
{
|
||||
public UcCheckBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.CheckBoxCheckColor = GlobalConfig.MainColor;
|
||||
this.CheckBoxBorderColor = GlobalConfig.BorderColor;
|
||||
}
|
||||
|
||||
public UcCheckBox(IContainer container)
|
||||
{
|
||||
container.Add(this);
|
||||
this.CheckBoxCheckColor = GlobalConfig.MainColor;
|
||||
this.CheckBoxBorderColor = GlobalConfig.BorderColor;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private int checkBoxSize = 12;
|
||||
public Color CheckBoxColor = Color.White;
|
||||
public Color CheckBoxCheckColor = GlobalConfig.DefaultMainColor;
|
||||
public Color CheckBoxBorderColor = GlobalConfig.DefaultBorderColor;
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
//base.OnPaint(e); // 禁用系统绘制全部
|
||||
base.OnPaintBackground(e); // 使用系统绘制背景
|
||||
|
||||
//if (e.ClipRectangle.X != 0 || e.ClipRectangle.Y != 0)
|
||||
// return;
|
||||
|
||||
Graphics g = e.Graphics;
|
||||
//g.Clear(this.CheckBoxColor);
|
||||
|
||||
//填充背景色
|
||||
//g.FillRectangle(new SolidBrush(this.BackColor), e.ClipRectangle);
|
||||
g.FillRectangle(new SolidBrush(this.BackColor), this.ClientRectangle);
|
||||
|
||||
Size size = TextRenderer.MeasureText(this.Text, Font);
|
||||
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; // 或者 AntiAliasGridFit // 平滑字体
|
||||
//e.Graphics.DrawString(this.Text, Font, new SolidBrush(this.ForeColor),
|
||||
// new PointF(e.ClipRectangle.X + checkBoxSize + 2 + Padding.Left, e.ClipRectangle.Y + (Height - size.Height) / 2));
|
||||
e.Graphics.DrawString(this.Text, Font, new SolidBrush(this.ForeColor),
|
||||
new PointF(this.ClientRectangle.X + checkBoxSize + 2 + Padding.Left, this.ClientRectangle.Y + (Height - size.Height) / 2));
|
||||
|
||||
Rectangle rt = new Rectangle();
|
||||
rt.X = 0;
|
||||
rt.Y = (Height - checkBoxSize) / 2;
|
||||
rt.Width = checkBoxSize;
|
||||
rt.Height = checkBoxSize;
|
||||
|
||||
if (this.Enabled == false)
|
||||
DrawCheckBoxIcon(g, rt, this.Checked, Color.LightGray, Color.DarkGray, Color.Gray);
|
||||
else
|
||||
DrawCheckBoxIcon(g, rt, this.Checked, this.CheckBoxColor, this.CheckBoxCheckColor, this.CheckBoxBorderColor);
|
||||
}
|
||||
|
||||
public static void DrawCheckBoxIcon(Graphics g, Rectangle rt, bool isChecked, Color checkBoxColor, Color checkBoxCheckColor, Color checkBoxBorderColor)
|
||||
{
|
||||
//绘制圆形(注释此句,以备后用)
|
||||
//Brush brush = new SolidBrush(this.Checked ? checkBoxCheckColor : checkBoxColor);
|
||||
//g.FillEllipse(brush, 0, (Height - checkBoxSize) / 2, checkBoxSize, checkBoxSize); // 绘制圆形按钮
|
||||
|
||||
Color color = isChecked ? checkBoxCheckColor : checkBoxColor;
|
||||
|
||||
if (isChecked)
|
||||
{
|
||||
DrawRoundedRectangle(g, rt, 2, color, true);
|
||||
DrawRoundedRectangle(g, rt, 2, checkBoxBorderColor);
|
||||
|
||||
// 绘制勾号
|
||||
Pen p = new Pen(Color.FromArgb(220, 255, 255, 255), 1);
|
||||
//g.DrawLine(Pens.SkyBlue, rt.X + 3, rt.Y + 6, rt.X + 5, rt.Y + 8);
|
||||
//g.DrawLine(Pens.SkyBlue, rt.X + 5, rt.Y + 8, rt.X + 9, rt.Y + 4);
|
||||
g.DrawLine(p, rt.X + 3, rt.Y + 5, rt.X + 5, rt.Y + 7);
|
||||
g.DrawLine(p, rt.X + 5, rt.Y + 7, rt.X + 9, rt.Y + 3);
|
||||
g.DrawLine(p, rt.X + 3, rt.Y + 6, rt.X + 5, rt.Y + 8);
|
||||
g.DrawLine(p, rt.X + 5, rt.Y + 8, rt.X + 9, rt.Y + 4);
|
||||
g.DrawLine(p, rt.X + 3, rt.Y + 7, rt.X + 5, rt.Y + 9);
|
||||
g.DrawLine(p, rt.X + 5, rt.Y + 9, rt.X + 9, rt.Y + 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawRoundedRectangle(g, rt, 3, color, true);
|
||||
DrawRoundedRectangle(g, rt, 3, checkBoxBorderColor);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawRoundedRectangle(Graphics g, Rectangle rect, int radius, Color color, bool isFill = false)
|
||||
{
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
path.StartFigure();
|
||||
path.AddArc(rect.X, rect.Y, radius * 2, radius * 2, 180, 90); // Upper left corner
|
||||
path.AddArc(rect.Right - radius * 2, rect.Y, radius * 2, radius * 2, 270, 90); // Upper right corner
|
||||
path.AddArc(rect.Right - radius * 2, rect.Bottom - radius * 2, radius * 2, radius * 2, 0, 90); // Lower right corner
|
||||
path.AddArc(rect.X, rect.Bottom - radius * 2, radius * 2, radius * 2, 90, 90); // Lower left corner
|
||||
path.CloseFigure();
|
||||
//g.FillPath(Brushes.LightBlue, path);
|
||||
if (isFill)
|
||||
g.FillPath(new SolidBrush(color), path); // Fill the rounded rectangle
|
||||
else
|
||||
g.DrawPath(new Pen(color), path);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
protected override void OnDrawItem(DrawItemEventArgs e)
|
||||
{
|
||||
//int ItemsCount = Items.Count;
|
||||
//Rectangle rect = new Rectangle(0, 0, e.Bounds.Width, e.Bounds.Height * ItemsCount);
|
||||
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
|
||||
//// 绘制下拉框背景
|
||||
//e.Graphics.FillRectangle(new SolidBrush(_BoxCenterColor), rect);
|
||||
//// 绘制下拉框边框
|
||||
//e.Graphics.DrawRectangle(new Pen(new SolidBrush(_BorderColor)), rect);
|
||||
//// 绘制选中文字背景
|
||||
//for (int i = 0; i < Items.Count; i++)
|
||||
//{
|
||||
// if (SelectedItem != null)
|
||||
// {
|
||||
// if (SelectedItem.ToString() == Items[i].ToString())
|
||||
// {
|
||||
// Rectangle rectSel = new Rectangle(1, e.Bounds.Height * (SelectedIndex), e.Bounds.Width - 2, e.Bounds.Height - 2);
|
||||
// e.Graphics.FillRectangle(new SolidBrush(Color.White), rectSel);
|
||||
// }
|
||||
// }
|
||||
// // 绘制文字
|
||||
// e.Graphics.DrawString(Items[i].ToString(), Font, new SolidBrush(_FontColor), new PointF(0, i * (e.Bounds.Height == 0 ? 16 : e.Bounds.Height)));
|
||||
//}
|
||||
|
||||
if (e.Index >= 0)
|
||||
{
|
||||
e.Graphics.FillRectangle(new SolidBrush(_BoxCenterColor), e.Bounds);
|
||||
if ((e.State & DrawItemState.Focus) == DrawItemState.Focus || (e.State & DrawItemState.Selected) == DrawItemState.Selected)
|
||||
{
|
||||
// 设置鼠标悬浮ComboBox的item的背景色
|
||||
e.Graphics.FillRectangle(Brushes.White, e.Bounds);
|
||||
}
|
||||
else if (((e.State & DrawItemState.ComboBoxEdit) != DrawItemState.ComboBoxEdit))
|
||||
{
|
||||
// 默认背景
|
||||
e.Graphics.FillRectangle(new SolidBrush(e.BackColor), e.Bounds);
|
||||
}
|
||||
// 绘制文字
|
||||
e.Graphics.DrawString(Items[e.Index].ToString(), Font, new SolidBrush(_FontColor), new PointF(e.Bounds.X, e.Bounds.Y));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user