temu客户端程序

This commit is contained in:
wule committed 2025-06-29 19:38:31 +08:00
commit 4aaf264e89
694 files changed
+263780

No files matched your search

+91
View File
@@ -0,0 +1,91 @@
using AllBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.BaseForms
{
public partial class BaseMsgForm : LRBaseForm
{
public BaseMsgForm()
{
InitializeComponent();
this.ShowMinimizedBox = false;
this.AcceptButton = pnlConfirm;
}
public static BaseMsgForm ShowInfo(string msg, string caption = "", FormLevel fl = FormLevel.MEDIUM)
{
string title = string.IsNullOrEmpty(caption) ? "系统提示" : caption;
BaseMsgForm msgBox = CreateMsgForm(msg, fl, title);
msgBox.picTip.Image = global::LittleRabbit.Properties.Resources.BaseMsgInfo;
msgBox.ShowDialog();
return msgBox;
}
private static BaseMsgForm CreateMsgForm(string msg, FormLevel fl, string title)
{
BaseMsgForm msgBox = new BaseMsgForm { Text = title, lblMsg = { Text = msg }, TitleText = title };
if (fl.Equals(FormLevel.LARGE))
{
msgBox.Width = (int)FormLevel.LARGE;
msgBox.Height = 280;
}
msgBox.pnlConfirm.Location = msgBox.pnlCancel.Location; // 把确认按钮移到取消按钮上面
msgBox.pnlCancel.Visible = false;
return msgBox;
}
public static BaseMsgForm ShowError(string msg, string caption = "", FormLevel fl = FormLevel.MEDIUM)
{
string title = string.IsNullOrEmpty(caption) ? "系统错误" : caption;
BaseMsgForm msgBox = CreateMsgForm(msg, fl, title);
msgBox.picTip.Image = global::LittleRabbit.Properties.Resources.BaseMsgErr;
msgBox.ShowDialog();
return msgBox;
}
public static BaseMsgForm ShowConfirm(string msg, string caption = "", FormLevel fl = FormLevel.MEDIUM, bool isTopMost = false)
{
string title = string.IsNullOrEmpty(caption) ? "系统提示确认" : caption;
BaseMsgForm msgBox = new BaseMsgForm
{
Text = title,
lblMsg = { Text = msg },
TitleText = title,
picTip = { Image = global::LittleRabbit.Properties.Resources.BaseMsgQue },
TopMost = isTopMost
};
if (fl.Equals(FormLevel.LARGE))
{
msgBox.Width = (int)FormLevel.LARGE;
}
msgBox.ShowDialog();
return msgBox;
}
private void PnlConfirm_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void PnlCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
public enum FormLevel
{
SMALL,
MEDIUM,
LARGE = 500
}
}
+143
View File
@@ -0,0 +1,143 @@
namespace LittleRabbit.LittleRabbitForms.BaseForms
{
partial class BaseMsgForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel2 = new System.Windows.Forms.Panel();
this.pnlCancel = new DevComponents.DotNetBar.PanelEx();
this.pnlConfirm = new DevComponents.DotNetBar.PanelEx();
this.picTip = new System.Windows.Forms.PictureBox();
this.lblMsg = new System.Windows.Forms.Label();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picTip)).BeginInit();
this.SuspendLayout();
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.pnlCancel);
this.panel2.Controls.Add(this.pnlConfirm);
this.panel2.Controls.Add(this.picTip);
this.panel2.Controls.Add(this.lblMsg);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(1, 33);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(386, 183);
this.panel2.TabIndex = 1;
//
// pnlCancel
//
this.pnlCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.pnlCancel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlCancel.Cursor = System.Windows.Forms.Cursors.Hand;
this.pnlCancel.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlCancel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.pnlCancel.Location = new System.Drawing.Point(284, 132);
this.pnlCancel.Name = "pnlCancel";
this.pnlCancel.Size = new System.Drawing.Size(80, 30);
this.pnlCancel.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pnlCancel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.pnlCancel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.pnlCancel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.pnlCancel.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlCancel.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
this.pnlCancel.Style.ForeColor.Color = System.Drawing.Color.Black;
this.pnlCancel.Style.GradientAngle = 90;
this.pnlCancel.TabIndex = 27;
this.pnlCancel.Text = "取 消";
this.pnlCancel.Click += new System.EventHandler(this.PnlCancel_Click);
//
// pnlConfirm
//
this.pnlConfirm.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.pnlConfirm.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlConfirm.Cursor = System.Windows.Forms.Cursors.Hand;
this.pnlConfirm.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlConfirm.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.pnlConfirm.Location = new System.Drawing.Point(167, 132);
this.pnlConfirm.Name = "pnlConfirm";
this.pnlConfirm.Size = new System.Drawing.Size(80, 30);
this.pnlConfirm.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pnlConfirm.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlConfirm.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlConfirm.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.pnlConfirm.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.pnlConfirm.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.pnlConfirm.Style.ForeColor.Color = System.Drawing.Color.White;
this.pnlConfirm.Style.GradientAngle = 90;
this.pnlConfirm.TabIndex = 26;
this.pnlConfirm.Text = "确 定";
this.pnlConfirm.Click += new System.EventHandler(this.PnlConfirm_Click);
//
// picTip
//
this.picTip.Location = new System.Drawing.Point(21, 33);
this.picTip.Name = "picTip";
this.picTip.Size = new System.Drawing.Size(64, 64);
this.picTip.TabIndex = 19;
this.picTip.TabStop = false;
//
// lblMsg
//
this.lblMsg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMsg.Location = new System.Drawing.Point(110, 17);
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(254, 100);
this.lblMsg.TabIndex = 18;
this.lblMsg.Text = "信息";
this.lblMsg.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// BaseMsgForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(388, 217);
this.Controls.Add(this.panel2);
this.Name = "BaseMsgForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "BaseMsgForm";
this.TitleText = "BaseMsgForm";
this.Controls.SetChildIndex(this.panel2, 0);
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picTip)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel2;
private DevComponents.DotNetBar.PanelEx pnlCancel;
private DevComponents.DotNetBar.PanelEx pnlConfirm;
private System.Windows.Forms.PictureBox picTip;
private System.Windows.Forms.Label lblMsg;
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+361
View File
@@ -0,0 +1,361 @@
using AllBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.BaseForms
{
public partial class LRBaseForm : Form
{
const int WM_NCHITTEST = 0x0084;
const int HTLEFT = 10; //左边界
const int HTRIGHT = 11; //右边界
const int HTTOP = 12; //上边界
const int HTTOPLEFT = 13; //左上角
const int HTTOPRIGHT = 14; //右上角
const int HTBOTTOM = 15; //下边界
const int HTBOTTOMLEFT = 0x10; //左下角
const int HTBOTTOMRIGHT = 17; //右下角
public bool Dragable { get; set; } = true;
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_NCHITTEST:
base.WndProc(ref m);
Point vPoint = new Point((int)m.LParam & 0xFFFF,
(int)m.LParam >> 16 & 0xFFFF);
vPoint = PointToClient(vPoint);
if (vPoint.X <= 5)
if (vPoint.Y <= 5)
m.Result = (IntPtr)HTTOPLEFT;
else if (vPoint.Y >= ClientSize.Height - 5)
m.Result = (IntPtr)HTBOTTOMLEFT;
else m.Result = (IntPtr)HTLEFT;
else if (vPoint.X >= ClientSize.Width - 5)
if (vPoint.Y <= 5)
m.Result = (IntPtr)HTTOPRIGHT;
else if (vPoint.Y >= ClientSize.Height - 5)
m.Result = (IntPtr)HTBOTTOMRIGHT;
else m.Result = (IntPtr)HTRIGHT;
else if (vPoint.Y <= 5)
m.Result = (IntPtr)HTTOP;
else if (vPoint.Y >= ClientSize.Height - 5)
m.Result = (IntPtr)HTBOTTOM;
break;
default:
base.WndProc(ref m);
break;
}
this.Resize += LRBaseForm_Resize;
}
private void LRBaseForm_Resize(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Maximized)
{
pbMaxBase.Visible = false;
pbNormalBase.Visible = true;
if (showMinimizedBox)
pbMinBase.Visible = true;
}
else if (WindowState == FormWindowState.Minimized)
{
}
else
{
if (showMaximizeBox)
pbMaxBase.Visible = true;
pbNormalBase.Visible = false;
if (showMinimizedBox)
pbMinBase.Visible = true;
}
if (!showMinimizedBox)
this.pbMinBase.Visible = false;
if (!showMaximizeBox)
{
this.pbMaxBase.Visible = false;
this.pbNormalBase.Visible = false;
}
}
public LRBaseForm()
{
InitializeComponent();
this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
}
private void LcBaseForm_Load(object sender, EventArgs e)
{
if (BaseClass.Ico != null)
Iconx = Icon = BaseClass.Ico;
else
Iconx = this.Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(global::LittleRabbit.Properties.Resources.icon);
if (!this.ShowIcon)
{
this.pbLogo.Visible = false;
this.lbTitle.Location = new Point(this.pbLogo.Location.X, this.lbTitle.Location.Y);
}
if (this.ShowMaximizeBox)
{
if (this.WindowState == FormWindowState.Maximized)
{
this.pbMaxBase.Visible = false;
this.pbNormalBase.Visible = true;
}
else
{
this.pbMaxBase.Visible = true;
this.pbNormalBase.Visible = false;
}
}
if (this.TopLevel || DesignMode)
{
this.Padding = new Padding(1);
this.panel1.Visible = true;
}
else
{
this.Padding = new Padding(0);
this.panel1.Visible = false;
}
}
private void PictureBox2_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Minimized;
}
public virtual void PictureBox1_Click(object sender, EventArgs e)
{
//pictureBox3.Image?.Dispose();
Close();
}
private Icon _iconx;
public Icon Iconx
{
set
{
_iconx = value;
if (_iconx == null) return;
pbLogo.Image = _iconx.ToBitmap();
}
}
private bool showMinimizedBox = true;
[Browsable(true), Description("显示最小化按钮"), Category("自定义分组")]
public bool ShowMinimizedBox
{
get
{
return showMinimizedBox;
}
set
{
this.showMinimizedBox = value;
}
}
private bool showMaximizeBox = false;
[Browsable(true), Description("显示最大化按钮"), Category("自定义分组")]
public bool ShowMaximizeBox
{
get { return showMaximizeBox; }
set
{
showMaximizeBox = value;
if (showMaximizeBox)
{
if (this.WindowState == FormWindowState.Maximized)
{
this.pbMaxBase.Visible = false;
this.pbNormalBase.Visible = true;
}
else
{
this.pbMaxBase.Visible = true;
this.pbNormalBase.Visible = false;
}
}
else
{
this.pbMaxBase.Visible = false;
this.pbNormalBase.Visible = false;
}
}
}
public string TitleText
{
get
{
return Text;
}
set
{
lbTitle.Text = Text = value;
}
}
private Point mouseOffset;//记录鼠标指针的坐标
private bool isMouseDown;//记录鼠标左键是否按下
private void Panel1_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown && Dragable)
{
//获取鼠标的位置
Point mousePos = MousePosition;
mousePos.Offset(mouseOffset.X, mouseOffset.Y);
Location = mousePos;
}
}
private void Panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mouseOffset = new Point(-e.X, -e.Y);
isMouseDown = true;
}
}
private void Panel1_MouseUp(object sender, MouseEventArgs e)
{
isMouseDown = false;
}
private void PictureBox1_MouseHover(object sender, EventArgs e)
{
this.pbCloseBase.Image = global::LittleRabbit.Properties.Resources.close_hover;
this.Cursor = Cursors.Hand;
}
private void PictureBox1_MouseLeave(object sender, EventArgs e)
{
this.pbCloseBase.Image = global::LittleRabbit.Properties.Resources.close;
this.Cursor = Cursors.Default;
}
private void PictureBox2_MouseHover(object sender, EventArgs e)
{
this.pbMinBase.Image = global::LittleRabbit.Properties.Resources.min_hover;
this.Cursor = Cursors.Hand;
}
private void PictureBox2_MouseLeave(object sender, EventArgs e)
{
this.pbMinBase.Image = global::LittleRabbit.Properties.Resources.min;
this.Cursor = Cursors.Default;
}
public virtual void HideTitle()
{
this.panel1.Visible = false;
}
#region 窗体提交数据完成事件
public event Action<object> SaveComplete;
protected virtual void OnSaveComplete(object param)
{
this.SaveComplete?.Invoke(param);
}
public event Action<object, object> SaveCompleteWithDescribe;
protected virtual void OnSaveComplete(object param, object describe)
{
this.SaveCompleteWithDescribe?.Invoke(param, describe);
}
#endregion
private void pbNormalBase_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Normal;
this.pbMaxBase.Visible = true;
this.pbNormalBase.Visible = false;
}
private void pbNormalBase_MouseHover(object sender, EventArgs e)
{
this.pbNormalBase.Image = global::LittleRabbit.Properties.Resources.normal_hover;
this.Cursor = Cursors.Hand;
}
private void pbNormalBase_MouseLeave(object sender, EventArgs e)
{
this.pbNormalBase.Image = global::LittleRabbit.Properties.Resources.normal;
this.Cursor = Cursors.Default;
}
private void pbMaxBase_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Maximized;
this.pbMaxBase.Visible = false;
this.pbNormalBase.Visible = true;
}
private void pbMaxBase_MouseHover(object sender, EventArgs e)
{
this.pbMaxBase.Image = global::LittleRabbit.Properties.Resources.max_hover;
this.Cursor = Cursors.Hand;
}
private void pbMaxBase_MouseLeave(object sender, EventArgs e)
{
this.pbMaxBase.Image = global::LittleRabbit.Properties.Resources.max;
this.Cursor = Cursors.Default;
}
private void lbTitle_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mouseOffset = new Point(-e.X, -e.Y);
isMouseDown = true;
}
}
private void lbTitle_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown && Dragable)
{
var control = sender as Control;
if (control == null)
return;
//获取鼠标的位置
Point mousePos = MousePosition;
var x = mouseOffset.X;
var y = mouseOffset.Y;
while (control.Parent != null && control.Parent != this)
{
x -= control.Location.X;
y -= control.Location.Y;
control = control.Parent;
}
mousePos.Offset(x, y);
Location = mousePos;
}
}
private void lbTitle_MouseUp(object sender, MouseEventArgs e)
{
isMouseDown = false;
}
}
}
+181
View File
@@ -0,0 +1,181 @@
namespace LittleRabbit.LittleRabbitForms.BaseForms
{
partial class LRBaseForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.pbMinBase = new System.Windows.Forms.PictureBox();
this.pbNormalBase = new System.Windows.Forms.PictureBox();
this.pbMaxBase = new System.Windows.Forms.PictureBox();
this.pbLogo = new System.Windows.Forms.PictureBox();
this.lbTitle = new System.Windows.Forms.Label();
this.pbCloseBase = new System.Windows.Forms.PictureBox();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbMinBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbNormalBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbMaxBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbLogo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panel1.Controls.Add(this.pbMinBase);
this.panel1.Controls.Add(this.pbNormalBase);
this.panel1.Controls.Add(this.pbMaxBase);
this.panel1.Controls.Add(this.pbLogo);
this.panel1.Controls.Add(this.lbTitle);
this.panel1.Controls.Add(this.pbCloseBase);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(1, 1);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(657, 32);
this.panel1.TabIndex = 0;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Panel1_MouseDown);
this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Panel1_MouseMove);
this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Panel1_MouseUp);
//
// pbMinBase
//
this.pbMinBase.Dock = System.Windows.Forms.DockStyle.Right;
this.pbMinBase.Image = global::LittleRabbit.Properties.Resources.min;
this.pbMinBase.Location = new System.Drawing.Point(529, 0);
this.pbMinBase.Name = "pbMinBase";
this.pbMinBase.Size = new System.Drawing.Size(32, 32);
this.pbMinBase.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbMinBase.TabIndex = 1;
this.pbMinBase.TabStop = false;
this.pbMinBase.Click += new System.EventHandler(this.PictureBox2_Click);
this.pbMinBase.MouseLeave += new System.EventHandler(this.PictureBox2_MouseLeave);
this.pbMinBase.MouseHover += new System.EventHandler(this.PictureBox2_MouseHover);
//
// pbNormalBase
//
this.pbNormalBase.Dock = System.Windows.Forms.DockStyle.Right;
this.pbNormalBase.Image = global::LittleRabbit.Properties.Resources.normal;
this.pbNormalBase.Location = new System.Drawing.Point(561, 0);
this.pbNormalBase.Name = "pbNormalBase";
this.pbNormalBase.Size = new System.Drawing.Size(32, 32);
this.pbNormalBase.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbNormalBase.TabIndex = 6;
this.pbNormalBase.TabStop = false;
this.pbNormalBase.Visible = false;
this.pbNormalBase.Click += new System.EventHandler(this.pbNormalBase_Click);
this.pbNormalBase.MouseLeave += new System.EventHandler(this.pbNormalBase_MouseLeave);
this.pbNormalBase.MouseHover += new System.EventHandler(this.pbNormalBase_MouseHover);
//
// pbMaxBase
//
this.pbMaxBase.Dock = System.Windows.Forms.DockStyle.Right;
this.pbMaxBase.Image = global::LittleRabbit.Properties.Resources.max;
this.pbMaxBase.Location = new System.Drawing.Point(593, 0);
this.pbMaxBase.Name = "pbMaxBase";
this.pbMaxBase.Size = new System.Drawing.Size(32, 32);
this.pbMaxBase.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbMaxBase.TabIndex = 5;
this.pbMaxBase.TabStop = false;
this.pbMaxBase.Visible = false;
this.pbMaxBase.Click += new System.EventHandler(this.pbMaxBase_Click);
this.pbMaxBase.MouseLeave += new System.EventHandler(this.pbMaxBase_MouseLeave);
this.pbMaxBase.MouseHover += new System.EventHandler(this.pbMaxBase_MouseHover);
//
// pbLogo
//
this.pbLogo.BackColor = System.Drawing.Color.Transparent;
this.pbLogo.Image = global::LittleRabbit.Properties.Resources.icon;
this.pbLogo.Location = new System.Drawing.Point(5, 4);
this.pbLogo.Name = "pbLogo";
this.pbLogo.Size = new System.Drawing.Size(23, 23);
this.pbLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pbLogo.TabIndex = 3;
this.pbLogo.TabStop = false;
//
// lbTitle
//
this.lbTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbTitle.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbTitle.ForeColor = System.Drawing.Color.White;
this.lbTitle.Location = new System.Drawing.Point(31, 7);
this.lbTitle.Name = "lbTitle";
this.lbTitle.Size = new System.Drawing.Size(588, 17);
this.lbTitle.TabIndex = 2;
this.lbTitle.Text = "label1";
this.lbTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbTitle_MouseDown);
this.lbTitle.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lbTitle_MouseMove);
this.lbTitle.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lbTitle_MouseUp);
//
// pbCloseBase
//
this.pbCloseBase.Dock = System.Windows.Forms.DockStyle.Right;
this.pbCloseBase.Image = global::LittleRabbit.Properties.Resources.close;
this.pbCloseBase.Location = new System.Drawing.Point(625, 0);
this.pbCloseBase.Name = "pbCloseBase";
this.pbCloseBase.Size = new System.Drawing.Size(32, 32);
this.pbCloseBase.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbCloseBase.TabIndex = 0;
this.pbCloseBase.TabStop = false;
this.pbCloseBase.Click += new System.EventHandler(this.PictureBox1_Click);
this.pbCloseBase.MouseLeave += new System.EventHandler(this.PictureBox1_MouseLeave);
this.pbCloseBase.MouseHover += new System.EventHandler(this.PictureBox1_MouseHover);
//
// LRBaseForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(98)))), ((int)(((byte)(200)))));
this.ClientSize = new System.Drawing.Size(659, 535);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "LRBaseForm";
this.Padding = new System.Windows.Forms.Padding(1);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "LcBaseForm";
this.Load += new System.EventHandler(this.LcBaseForm_Load);
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbMinBase)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbNormalBase)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbMaxBase)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbLogo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.PictureBox pbMinBase;
private System.Windows.Forms.PictureBox pbCloseBase;
private System.Windows.Forms.Label lbTitle;
private System.Windows.Forms.PictureBox pbLogo;
private System.Windows.Forms.PictureBox pbNormalBase;
private System.Windows.Forms.PictureBox pbMaxBase;
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>