Commit 541f0daa kwwwvagaa

增加3个控件

1 个父辈 00af66e3
namespace HZH_Controls.Controls
{
partial class UCDialAisle
{
/// <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();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}
namespace HZH_Controls.Controls
{
partial class UCRotor
{
/// <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.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// UCRotor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UCRotor";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Timer timer1;
}
}
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;
using System.Drawing.Drawing2D;
namespace HZH_Controls.Controls
{
public partial class UCRotor : UserControl
{
private Color rotorColor = Color.Black;
public Color RotorColor
{
get { return rotorColor; }
set
{
rotorColor = value;
Refresh();
}
}
RotorAround rotorAround = RotorAround.None;
int jiaodu = 0;
public RotorAround RotorAround
{
get { return rotorAround; }
set
{
rotorAround = value;
if (value == RotorAround.None)
{
timer1.Enabled = false;
jiaodu = 0;
Refresh();
}
else
timer1.Enabled = true;
}
}
private int speed = 100;
[Description("旋转速度,100-1000,值越小 速度越快"), Category("自定义")]
public int Speed
{
get { return speed; }
set
{
if (value < 100 || value > 1000)
return;
speed = value;
timer1.Interval = value;
}
}
int maxWidth = 0;
int one = 0;
Dictionary<int, GraphicsPath> lstCachePath = new Dictionary<int, GraphicsPath>();
public UCRotor()
{
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
maxWidth = Math.Min(this.Width, this.Height);
one = maxWidth / 10;
ResetPathCache();
this.SizeChanged += UCRotor_SizeChanged;
}
void UCRotor_SizeChanged(object sender, EventArgs e)
{
maxWidth = Math.Min(this.Width, this.Height);
one = maxWidth / 10;
ResetPathCache();
}
private void ResetPathCache()
{
for (int i = 0; i < 180; i += 15)
{
Bitmap bitcache = new Bitmap(Width, Height);
var gimg = Graphics.FromImage(bitcache);
gimg.SetGDIHigh();
gimg.Clear(Color.Red);
gimg.TranslateTransform(Width / 2, Height / 2);
// 旋转画板
gimg.RotateTransform(i);
// 回退画板x,y轴移动过的距离
gimg.TranslateTransform(-(Width / 2), -(Height / 2));
gimg.FillEllipse(new SolidBrush(Color.Black), new Rectangle((this.Width - maxWidth) / 2, (this.Height - maxWidth) / 2 + maxWidth / 4 + maxWidth / 8, maxWidth / 2, maxWidth / 2 - maxWidth / 4));
gimg.FillEllipse(new SolidBrush(Color.Black), new Rectangle(this.Width / 2, (this.Height - maxWidth) / 2 + maxWidth / 4 + maxWidth / 8, maxWidth / 2, maxWidth / 2 - maxWidth / 4));
gimg.FillEllipse(new SolidBrush(Color.Black), new Rectangle((this.Width - maxWidth) / 2 + maxWidth / 2 - maxWidth / 8, (this.Height - maxWidth) / 2 + maxWidth / 2 - maxWidth / 8, maxWidth / 4, maxWidth / 4));
gimg.Dispose();
var borderPath = new GraphicsPath();
borderPath.AddLines(GetBorderPoints(bitcache, Color.Red).ToArray());
borderPath.CloseAllFigures();
lstCachePath[i] = borderPath;
bitcache.Dispose();
}
}
/// <summary>
/// Gets the border points.
/// </summary>
/// <param name="bit">The bit.</param>
/// <param name="transparent">The transparent.</param>
/// <returns>List&lt;PointF&gt;.</returns>
private List<PointF> GetBorderPoints(Bitmap bit, Color transparent)
{
float diameter = (float)Math.Sqrt(bit.Width * bit.Width + bit.Height * bit.Height);
int intSplit = 0;
intSplit = (int)(7 - (diameter - 200) / 100);
if (intSplit < 1)
intSplit = 1;
List<PointF> lstPoint = new List<PointF>();
for (int i = 0; i < 360; i += intSplit)
{
for (int j = (int)diameter / 2; j > 5; j--)
{
Point p = GetPointByAngle(i, j, new PointF(bit.Width / 2, bit.Height / 2));
if (p.X < 0 || p.Y < 0 || p.X >= bit.Width || p.Y >= bit.Height)
continue;
Color _color = bit.GetPixel(p.X, p.Y);
if (!(((int)_color.A) <= 50 || IsLikeColor(_color, transparent)))
{
if (!lstPoint.Contains(p))
{
lstPoint.Add(p);
}
break;
}
}
}
return lstPoint;
}
/// <summary>
/// Determines whether [is like color] [the specified color1].
/// </summary>
/// <param name="color1">The color1.</param>
/// <param name="color2">The color2.</param>
/// <returns><c>true</c> if [is like color] [the specified color1]; otherwise, <c>false</c>.</returns>
private bool IsLikeColor(Color color1, Color color2)
{
var cv = Math.Sqrt(Math.Pow((color1.R - color2.R), 2) + Math.Pow((color1.G - color2.G), 2) + Math.Pow((color1.B - color2.B), 2));
if (cv <= 10)
return true;
else
return false;
}
#region 根据角度得到坐标 English:Get coordinates from angles
/// <summary>
/// 功能描述:根据角度得到坐标 English:Get coordinates from angles
/// 作  者:HZH
/// 创建日期:2019-09-28 11:56:25
/// 任务编号:POS
/// </summary>
/// <param name="angle">angle</param>
/// <param name="radius">radius</param>
/// <param name="origin">origin</param>
/// <returns>返回值</returns>
private Point GetPointByAngle(float angle, float radius, PointF origin)
{
float y = origin.Y + (float)Math.Sin(Math.PI * (angle / 180.00F)) * radius;
float x = origin.X + (float)Math.Cos(Math.PI * (angle / 180.00F)) * radius;
return new Point((int)x, (int)y);
}
#endregion
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
this.Region = new System.Drawing.Region(lstCachePath[jiaodu]);
g.TranslateTransform(Width / 2, Height / 2);
// 旋转画板
g.RotateTransform(jiaodu);
// 回退画板x,y轴移动过的距离
g.TranslateTransform(-(Width / 2), -(Height / 2));
g.FillEllipse(new SolidBrush(rotorColor), new Rectangle((this.Width - maxWidth) / 2+5, (this.Height - maxWidth) / 2 + maxWidth / 4 + maxWidth / 8+2, maxWidth / 2-5, maxWidth / 2 - maxWidth / 4-4));
g.FillEllipse(new SolidBrush(rotorColor), new Rectangle(this.Width / 2, (this.Height - maxWidth) / 2 + maxWidth / 4 + maxWidth / 8+2, maxWidth / 2-5, maxWidth / 2 - maxWidth / 4-4));
g.FillEllipse(new SolidBrush(rotorColor), new Rectangle((this.Width - maxWidth) / 2 + maxWidth / 2 - maxWidth / 8, (this.Height - maxWidth) / 2 + maxWidth / 2 - maxWidth / 8, maxWidth / 4, maxWidth / 4));
g.FillEllipse(new SolidBrush(Color.FromArgb(10, Color.White)), new Rectangle((this.Width - maxWidth) / 2 + maxWidth / 2 - maxWidth / 8, (this.Height - maxWidth) / 2 + maxWidth / 2 - maxWidth / 8, maxWidth / 4, maxWidth / 4));
}
private void timer1_Tick(object sender, EventArgs e)
{
if (rotorAround == RotorAround.Clockwise)
{
jiaodu += 15;
if (jiaodu == 180)
jiaodu = 0;
}
else if (rotorAround == RotorAround.Counterclockwise)
{
jiaodu -= 15;
if (jiaodu < 0)
jiaodu = 165;
}
Refresh();
}
}
public enum RotorAround
{
/// <summary>
/// 不旋转
/// </summary>
None,
/// <summary>
/// 顺时针
/// </summary>
Clockwise,
/// <summary>
/// 逆时针
/// </summary>
Counterclockwise
}
}
<?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>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
namespace HZH_Controls.Controls
{
partial class UCTurntable
{
/// <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();
//
// UCTurntable
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UCTurntable";
this.Size = new System.Drawing.Size(383, 127);
this.ResumeLayout(false);
}
#endregion
}
}
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 UCTurntable : UserControl
{
private int rouletteHeight = 40;
[Description("轮盘高度"), Category("自定义")]
public int RouletteHeight
{
get { return rouletteHeight; }
set { rouletteHeight = value; }
}
private Color rouletteColor = Color.FromArgb(63, 63, 70);
[Description("轮盘颜色"), Category("自定义")]
public Color RouletteColor
{
get { return rouletteColor; }
set { rouletteColor = value; }
}
private int itemWidth = 35;
[Description("节点宽度"), Category("自定义")]
public int ItemWidth
{
get { return itemWidth; }
set
{
itemWidth = value;
if (items != null)
{
foreach (var i in items)
{
i.Value.Width = itemWidth;
}
}
}
}
private Color emptyItemColor = Color.FromArgb(214, 157, 113);
[Description("节点无内容时颜色"), Category("自定义")]
public Color EmptyItemColor
{
get { return emptyItemColor; }
set { emptyItemColor = value; }
}
private int showItemCount = 4;
[Description("显示的节点个数,必须小于等于总节点数量"), Category("自定义")]
public int ShowItemCount
{
get { return showItemCount; }
set { showItemCount = value; }
}
//显示节点左上角位置
private Dictionary<int, Point> lstShowItemPoints = new Dictionary<int, Point>();
private int itemCount = 10;
[Description("节点总数,必须大于等于ShowItemCount"), Category("自定义")]
public int ItemCount
{
get { return itemCount; }
set { itemCount = value; }
}
private Dictionary<int, UCBottle> items = new Dictionary<int, UCBottle>();
public void SetItems(Dictionary<int, UCBottle> value)
{
items = value;
if (value != null)
{
foreach (var i in value)
{
i.Value.Width = itemWidth;
i.Value.Height = this.Height - 10;
}
}
ReloadControls();
}
private int indexNum = 0;
public UCTurntable()
{
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.SizeChanged += UCTurntable_SizeChanged;
UCTurntable_SizeChanged(null, null);
}
void UCTurntable_SizeChanged(object sender, EventArgs e)
{
ReloadItemsLocation();
if (items != null)
{
foreach (var i in items)
{
i.Value.Height = this.Height - 10;
}
}
ReloadControls();
}
private void ReloadControls()
{
this.Controls.Clear();
if (items != null)
{
for (int i = 0; i < showItemCount; i++)
{
if (items.ContainsKey((i + indexNum) % (itemCount)))
{
items[(i + indexNum) % (itemCount)].Location = new Point(lstShowItemPoints[i].X, 5);
this.Controls.Add(items[(i + indexNum) % (itemCount)]);
}
}
}
}
private void ReloadItemsLocation()
{
int split = (this.Width - 10 * 2 - itemWidth) / (showItemCount - 1);
for (int i = 0; i < showItemCount; i++)
{
lstShowItemPoints[i] = new Point(10 + split * i, (this.Height - rouletteHeight) / 2);
}
ReloadControls();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.FillRectangle(new SolidBrush(rouletteColor), new Rectangle(0, (this.Height - rouletteHeight) / 2, this.Width, rouletteHeight));
foreach (var item in lstShowItemPoints)
{
g.FillRectangle(new SolidBrush(emptyItemColor), new Rectangle(item.Value, new Size(itemWidth, rouletteHeight)));
}
//渐变色
int _intPenWidth = rouletteHeight;
int intCount = _intPenWidth / 2 / 4;
for (int i = 0; i < intCount; i++)
{
int _penWidth = _intPenWidth / 2 - 4 * i;
if (_penWidth <= 0)
_penWidth = 1;
g.DrawLine(new Pen(new SolidBrush(Color.FromArgb(40, Color.White.R, Color.White.G, Color.White.B)), _penWidth),new Point(0,this.Height/2),new Point(this.Width,this.Height/2));
if (_penWidth == 1)
break;
}
}
public void LeftItem()
{
indexNum--;
if (indexNum < 0)
indexNum = itemCount - 1;
ReloadControls();
}
public void RightItem()
{
indexNum++;
if (indexNum >= itemCount)
indexNum = 0;
ReloadControls();
}
public void AddItem(int index, UCBottle item)
{
item.Width = itemWidth;
item.Height = this.Height - 10;
items[index] = item;
ReloadControls();
}
public void RemoveItem(int index)
{
if (items.ContainsKey(index))
{
this.Controls.Remove(items[index]);
items.Remove(index);
ReloadControls();
}
}
public void RemoveItem(UCBottle item)
{
if (items.ContainsValue(item))
{
items.Remove(items.FirstOrDefault(p => p.Value == item).Key);
this.Controls.Remove(item);
ReloadControls();
}
}
}
}
<?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>
\ No newline at end of file
......@@ -68,6 +68,24 @@
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\DataGridView\IDataGridViewCustomCell.cs" />
<Compile Include="Controls\FactoryControls\DialAisle\UCDialAisle.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\FactoryControls\DialAisle\UCDialAisle.Designer.cs">
<DependentUpon>UCDialAisle.cs</DependentUpon>
</Compile>
<Compile Include="Controls\FactoryControls\Rotor\UCRotor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\FactoryControls\Rotor\UCRotor.Designer.cs">
<DependentUpon>UCRotor.cs</DependentUpon>
</Compile>
<Compile Include="Controls\FactoryControls\Turntable\UCTurntable.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\FactoryControls\Turntable\UCTurntable.Designer.cs">
<DependentUpon>UCTurntable.cs</DependentUpon>
</Compile>
<Compile Include="Controls\GraphicalOverlay\GraphicalOverlayComponent.cs">
<SubType>Component</SubType>
</Compile>
......@@ -671,6 +689,12 @@
<EmbeddedResource Include="Controls\FactoryControls\MindMapping\UCMindMappingPanel.resx">
<DependentUpon>UCMindMappingPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\FactoryControls\Rotor\UCRotor.resx">
<DependentUpon>UCRotor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\FactoryControls\Turntable\UCTurntable.resx">
<DependentUpon>UCTurntable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\KeyBord\UCKeyBorderAll.resx">
<DependentUpon>UCKeyBorderAll.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -92,6 +92,9 @@ namespace Test
tnFactory.Nodes.Add("警示灯");
tnFactory.Nodes.Add("箭头");
tnFactory.Nodes.Add("温度计");
tnFactory.Nodes.Add("转子");
tnFactory.Nodes.Add("多通道转盘");
tnFactory.Nodes.Add("转盘");
this.tvMenu.Nodes.Add(tnFactory);
}
finally
......@@ -341,6 +344,15 @@ namespace Test
case "温度计":
AddControl(new UC.UCTestThermometer());
break;
case "转子":
AddControl(new UC.UCTestRotor());
break;
case "多通道转盘":
AddControl(new UC.UCTestDialAisle());
break;
case "转盘":
AddControl(new UC.UCTestTurntable());
break;
#endregion
}
}
......
......@@ -133,6 +133,12 @@
<Compile Include="UC\UCTestConveyor.Designer.cs">
<DependentUpon>UCTestConveyor.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestDialAisle.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestDialAisle.Designer.cs">
<DependentUpon>UCTestDialAisle.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestFunnelChart.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -526,6 +532,12 @@
<Compile Include="UC\UCTestRollText.Designer.cs">
<DependentUpon>UCTestRollText.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestRotor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestRotor.Designer.cs">
<DependentUpon>UCTestRotor.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestSampling.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -610,6 +622,12 @@
<Compile Include="UC\UCTestTreeview.Designer.cs">
<DependentUpon>UCTestTreeview.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestTurntable.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestTurntable.Designer.cs">
<DependentUpon>UCTestTurntable.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestValve.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -680,6 +698,9 @@
<EmbeddedResource Include="UC\UCTestConveyor.resx">
<DependentUpon>UCTestConveyor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestDialAisle.resx">
<DependentUpon>UCTestDialAisle.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestForms.resx">
<DependentUpon>UCTestForms.cs</DependentUpon>
</EmbeddedResource>
......@@ -872,6 +893,9 @@
<EmbeddedResource Include="UC\UCTestRollText.resx">
<DependentUpon>UCTestRollText.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestRotor.resx">
<DependentUpon>UCTestRotor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestSampling.resx">
<DependentUpon>UCTestSampling.cs</DependentUpon>
</EmbeddedResource>
......@@ -914,6 +938,9 @@
<EmbeddedResource Include="UC\UCTestTreeview.resx">
<DependentUpon>UCTestTreeview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestTurntable.resx">
<DependentUpon>UCTestTurntable.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestValve.resx">
<DependentUpon>UCTestValve.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -435,7 +435,7 @@
this.ucBottle2.BottleMouthColor = System.Drawing.Color.FromArgb(((int)(((byte)(105)))), ((int)(((byte)(105)))), ((int)(((byte)(105)))));
this.ucBottle2.Direction = HZH_Controls.Controls.Direction.Up;
this.ucBottle2.LiquidColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(169)))), ((int)(((byte)(243)))));
this.ucBottle2.Location = new System.Drawing.Point(935, 8);
this.ucBottle2.Location = new System.Drawing.Point(1011, 39);
this.ucBottle2.MaxValue = new decimal(new int[] {
100,
0,
......@@ -443,7 +443,7 @@
0});
this.ucBottle2.Name = "ucBottle2";
this.ucBottle2.NO = "1#";
this.ucBottle2.Size = new System.Drawing.Size(73, 150);
this.ucBottle2.Size = new System.Drawing.Size(36, 119);
this.ucBottle2.TabIndex = 53;
this.ucBottle2.Title = "";
this.ucBottle2.Value = new decimal(new int[] {
......
namespace Test.UC
{
partial class UCTestDialAisle
{
/// <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.ucDialAisle1 = new HZH_Controls.Controls.UCDialAisle();
this.ucBtnExt1 = new HZH_Controls.Controls.UCBtnExt();
this.ucBtnExt2 = new HZH_Controls.Controls.UCBtnExt();
this.SuspendLayout();
//
// ucDialAisle1
//
this.ucDialAisle1.DialColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(219)))), ((int)(((byte)(209)))));
this.ucDialAisle1.EnabledClick = false;
this.ucDialAisle1.ItemColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(221)))), ((int)(((byte)(224)))));
this.ucDialAisle1.ItemForeColor = System.Drawing.Color.Black;
this.ucDialAisle1.ItemSelectColor = System.Drawing.Color.Green;
this.ucDialAisle1.ItemSelectForeColor = System.Drawing.Color.White;
this.ucDialAisle1.ItemTexts = new string[] {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11"};
this.ucDialAisle1.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucDialAisle1.Location = new System.Drawing.Point(105, 67);
this.ucDialAisle1.Name = "ucDialAisle1";
this.ucDialAisle1.Size = new System.Drawing.Size(188, 182);
this.ucDialAisle1.TabIndex = 0;
//
// ucBtnExt1
//
this.ucBtnExt1.BackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt1.BtnForeColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnText = "随机连通一个";
this.ucBtnExt1.ConerRadius = 5;
this.ucBtnExt1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt1.EnabledMouseEffect = false;
this.ucBtnExt1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucBtnExt1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt1.IsRadius = true;
this.ucBtnExt1.IsShowRect = true;
this.ucBtnExt1.IsShowTips = false;
this.ucBtnExt1.Location = new System.Drawing.Point(40, 305);
this.ucBtnExt1.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt1.Name = "ucBtnExt1";
this.ucBtnExt1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnExt1.RectWidth = 1;
this.ucBtnExt1.Size = new System.Drawing.Size(127, 69);
this.ucBtnExt1.TabIndex = 1;
this.ucBtnExt1.TabStop = false;
this.ucBtnExt1.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt1.TipsText = "";
this.ucBtnExt1.BtnClick += new System.EventHandler(this.ucBtnExt1_BtnClick);
//
// ucBtnExt2
//
this.ucBtnExt2.BackColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt2.BtnForeColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnText = "移除连通";
this.ucBtnExt2.ConerRadius = 5;
this.ucBtnExt2.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt2.EnabledMouseEffect = false;
this.ucBtnExt2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucBtnExt2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt2.IsRadius = true;
this.ucBtnExt2.IsShowRect = true;
this.ucBtnExt2.IsShowTips = false;
this.ucBtnExt2.Location = new System.Drawing.Point(212, 305);
this.ucBtnExt2.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt2.Name = "ucBtnExt2";
this.ucBtnExt2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnExt2.RectWidth = 1;
this.ucBtnExt2.Size = new System.Drawing.Size(107, 69);
this.ucBtnExt2.TabIndex = 1;
this.ucBtnExt2.TabStop = false;
this.ucBtnExt2.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt2.TipsText = "";
this.ucBtnExt2.BtnClick += new System.EventHandler(this.ucBtnExt2_BtnClick);
//
// UCTestDialAisle
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ucBtnExt2);
this.Controls.Add(this.ucBtnExt1);
this.Controls.Add(this.ucDialAisle1);
this.Name = "UCTestDialAisle";
this.Size = new System.Drawing.Size(377, 466);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCDialAisle ucDialAisle1;
private HZH_Controls.Controls.UCBtnExt ucBtnExt1;
private HZH_Controls.Controls.UCBtnExt ucBtnExt2;
}
}
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 Test.UC
{
public partial class UCTestDialAisle : UserControl
{
public UCTestDialAisle()
{
InitializeComponent();
}
private void ucBtnExt1_BtnClick(object sender, EventArgs e)
{
this.ucDialAisle1.AddLink(new Random().Next(0, 10));
}
private void ucBtnExt2_BtnClick(object sender, EventArgs e)
{
this.ucDialAisle1.ClearAllLink();
}
}
}
<?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>
\ No newline at end of file
namespace Test.UC
{
partial class UCTestRotor
{
/// <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.ucRotor1 = new HZH_Controls.Controls.UCRotor();
this.ucRotor2 = new HZH_Controls.Controls.UCRotor();
this.ucRotor3 = new HZH_Controls.Controls.UCRotor();
this.SuspendLayout();
//
// ucRotor1
//
this.ucRotor1.Location = new System.Drawing.Point(29, 17);
this.ucRotor1.Name = "ucRotor1";
this.ucRotor1.RotorAround = HZH_Controls.Controls.RotorAround.Counterclockwise;
this.ucRotor1.RotorColor = System.Drawing.Color.Green;
this.ucRotor1.Size = new System.Drawing.Size(138, 130);
this.ucRotor1.Speed = 100;
this.ucRotor1.TabIndex = 0;
//
// ucRotor2
//
this.ucRotor2.Location = new System.Drawing.Point(185, 17);
this.ucRotor2.Name = "ucRotor2";
this.ucRotor2.RotorAround = HZH_Controls.Controls.RotorAround.Clockwise;
this.ucRotor2.RotorColor = System.Drawing.Color.Black;
this.ucRotor2.Size = new System.Drawing.Size(138, 130);
this.ucRotor2.Speed = 100;
this.ucRotor2.TabIndex = 0;
//
// ucRotor3
//
this.ucRotor3.Location = new System.Drawing.Point(361, 17);
this.ucRotor3.Name = "ucRotor3";
this.ucRotor3.RotorAround = HZH_Controls.Controls.RotorAround.None;
this.ucRotor3.RotorColor = System.Drawing.Color.Red;
this.ucRotor3.Size = new System.Drawing.Size(138, 130);
this.ucRotor3.Speed = 100;
this.ucRotor3.TabIndex = 0;
//
// UCTestRotor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.ucRotor3);
this.Controls.Add(this.ucRotor2);
this.Controls.Add(this.ucRotor1);
this.Name = "UCTestRotor";
this.Size = new System.Drawing.Size(654, 472);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCRotor ucRotor1;
private HZH_Controls.Controls.UCRotor ucRotor2;
private HZH_Controls.Controls.UCRotor ucRotor3;
}
}
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 Test.UC
{
public partial class UCTestRotor : UserControl
{
public UCTestRotor()
{
InitializeComponent();
}
}
}
<?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>
\ No newline at end of file
namespace Test.UC
{
partial class UCTestTurntable
{
/// <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.ucTurntable1 = new HZH_Controls.Controls.UCTurntable();
this.ucBtnExt1 = new HZH_Controls.Controls.UCBtnExt();
this.ucBtnExt2 = new HZH_Controls.Controls.UCBtnExt();
this.SuspendLayout();
//
// ucTurntable1
//
this.ucTurntable1.EmptyItemColor = System.Drawing.Color.FromArgb(((int)(((byte)(214)))), ((int)(((byte)(157)))), ((int)(((byte)(113)))));
this.ucTurntable1.ItemCount = 10;
this.ucTurntable1.ItemWidth = 35;
this.ucTurntable1.Location = new System.Drawing.Point(78, 106);
this.ucTurntable1.Name = "ucTurntable1";
this.ucTurntable1.RouletteColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(63)))), ((int)(((byte)(70)))));
this.ucTurntable1.RouletteHeight = 40;
this.ucTurntable1.ShowItemCount = 4;
this.ucTurntable1.Size = new System.Drawing.Size(394, 89);
this.ucTurntable1.TabIndex = 0;
//
// ucBtnExt1
//
this.ucBtnExt1.BackColor = System.Drawing.Color.Transparent;
this.ucBtnExt1.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt1.BtnForeColor = System.Drawing.Color.White;
this.ucBtnExt1.BtnText = "<<";
this.ucBtnExt1.ConerRadius = 5;
this.ucBtnExt1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt1.EnabledMouseEffect = false;
this.ucBtnExt1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucBtnExt1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt1.IsRadius = true;
this.ucBtnExt1.IsShowRect = true;
this.ucBtnExt1.IsShowTips = false;
this.ucBtnExt1.Location = new System.Drawing.Point(78, 228);
this.ucBtnExt1.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt1.Name = "ucBtnExt1";
this.ucBtnExt1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnExt1.RectWidth = 1;
this.ucBtnExt1.Size = new System.Drawing.Size(91, 31);
this.ucBtnExt1.TabIndex = 1;
this.ucBtnExt1.TabStop = false;
this.ucBtnExt1.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt1.TipsText = "";
this.ucBtnExt1.BtnClick += new System.EventHandler(this.ucBtnExt1_BtnClick);
//
// ucBtnExt2
//
this.ucBtnExt2.BackColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnBackColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ucBtnExt2.BtnForeColor = System.Drawing.Color.White;
this.ucBtnExt2.BtnText = ">>";
this.ucBtnExt2.ConerRadius = 5;
this.ucBtnExt2.Cursor = System.Windows.Forms.Cursors.Hand;
this.ucBtnExt2.EnabledMouseEffect = false;
this.ucBtnExt2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucBtnExt2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.ucBtnExt2.IsRadius = true;
this.ucBtnExt2.IsShowRect = true;
this.ucBtnExt2.IsShowTips = false;
this.ucBtnExt2.Location = new System.Drawing.Point(381, 228);
this.ucBtnExt2.Margin = new System.Windows.Forms.Padding(0);
this.ucBtnExt2.Name = "ucBtnExt2";
this.ucBtnExt2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(58)))));
this.ucBtnExt2.RectWidth = 1;
this.ucBtnExt2.Size = new System.Drawing.Size(91, 31);
this.ucBtnExt2.TabIndex = 1;
this.ucBtnExt2.TabStop = false;
this.ucBtnExt2.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(30)))), ((int)(((byte)(99)))));
this.ucBtnExt2.TipsText = "";
this.ucBtnExt2.BtnClick += new System.EventHandler(this.ucBtnExt2_BtnClick);
//
// UCTestTurntable
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ucBtnExt2);
this.Controls.Add(this.ucBtnExt1);
this.Controls.Add(this.ucTurntable1);
this.Name = "UCTestTurntable";
this.Size = new System.Drawing.Size(561, 442);
this.Load += new System.EventHandler(this.UCTestTurntable_Load);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCTurntable ucTurntable1;
private HZH_Controls.Controls.UCBtnExt ucBtnExt1;
private HZH_Controls.Controls.UCBtnExt ucBtnExt2;
}
}
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;
using HZH_Controls.Controls;
namespace Test.UC
{
public partial class UCTestTurntable : UserControl
{
public UCTestTurntable()
{
InitializeComponent();
}
private void UCTestTurntable_Load(object sender, EventArgs e)
{
Dictionary<int, UCBottle> lst = new Dictionary<int, UCBottle>();
for (int i = 0; i < 5; i++)
{
lst[i] = new UCBottle() { Direction = Direction.Up, NO = "#" + i };
}
this.ucTurntable1.SetItems(lst);
}
private void ucBtnExt1_BtnClick(object sender, EventArgs e)
{
this.ucTurntable1.LeftItem();
}
private void ucBtnExt2_BtnClick(object sender, EventArgs e)
{
this.ucTurntable1.RightItem();
}
}
}
<?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>
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!