Iocomp仪表控件iAngularGaugeX的使用c#2013
//****************************常用属性说明********************************************//
//ArcRadius:仪表半径,本处选择默认半径60
//ArcRangeDegrees:表盘角度范围,0~360度都可以选择
//ArcStartDegrees:表盘起始角度,180度即为正左方向
//AutoCenter:表盘位置,默认即可
//AutoSize :表盘自动随控件范围改变而改变,默认False,本处修改为True
//BackGroundColor:表盘背景颜色
//BackGroundPicture :背景图片
//BorderStyle:三种模式:凹入,凸出,正常
//HubColor:表盘中心颜色
//HubSize:表盘中心尺寸
//Label1:设置第一个文字(如果需要是该文字显现,需要在后面将ShowLable1属性改为True)
//Label2 :同上
//OuterMargin:表盘距控件范围边缘距离(默认5,本处修改为0)
//PointerColor:指针颜色
//PointerMargin:表针顶端距刻度距离
//PointerSize:表针尺寸
//PointerStyle:表针类型(共有四种)
//SectionColor:表盘刻度背景色
//SectionCount:片段取用数量
//SectionEnd:片段结束为止
//ShowHub:展现表针
//ShowInnerArcRadius:展现表盘刻度内圈线
//ShowLabel:显示文字
//ShowMaxPointer:显示表盘最大刻度点
//ShowInnerArcRadius:展现表盘刻度外圈线
//Tick:刻度属性设置(此处保持默认)
namespace WindowsFormsApplication19
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
iAngularGaugeX1.Position = 35;
ComponentValue.Value = 35 * 100;
iAngularGaugeX1.ResetMinMax();
}
private void 退出EToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void 关于AToolStripMenuItem_Click(object sender, EventArgs e)
{
frmAbout fa = new frmAbout();
fa.ShowDialog();
}
private void StopRandomizer_Click(object sender, EventArgs e)
{
timer1.Stop();
}
private void ResetMinMax_Click(object sender, EventArgs e)
{
iAngularGaugeX1.ResetMinMax();
}
private void SetStyle1_Click(object sender, EventArgs e)
{
iAngularGaugeX1.ArcRangeDegrees = 90;
iAngularGaugeX1.ArcStartDegrees = 180;
iAngularGaugeX1.PositionMax = 100;
iAngularGaugeX1.ShowHub = true;
iAngularGaugeX1.ShowOuterArcRadius = false;
iAngularGaugeX1.PointerStyle = isAnalogLibrary.TxiAngularGaugePointerStyle.iagpsTriangle;
iAngularGaugeX1.TickMajorCount = 5;
iAngularGaugeX1.TickMajorLength = 7;
iAngularGaugeX1.TickLabelPrecision = 1;
iAngularGaugeX1.TickMinorCount = 1;
iAngularGaugeX1.TickMinorLength = 3;
iAngularGaugeX1.TickMinorAlignment = isAnalogLibrary.TxiTickMinorAlignment.itmnaInside;
iAngularGaugeX1.TickLabelMargin = 15;
iAngularGaugeX1.SectionCount = 0;
iAngularGaugeX1.ShowLabel1 = false;
iAngularGaugeX1.ShowLabel2 = false;
iAngularGaugeX1.MinMaxPointerStyle = isAnalogLibrary.TxiAngularGaugePointerStyle.iagpsArrowLine;
}
private void ShowHideMinMax_Click(object sender, EventArgs e)
{
if (iAngularGaugeX1.ShowMinPointer){
iAngularGaugeX1.ShowMinPointer=false;
iAngularGaugeX1.ShowMaxPointer=false;
}
else{
iAngularGaugeX1.ShowMinPointer=true;
iAngularGaugeX1.ShowMaxPointer=true;
}
}
private void StartRandomizer_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void ComponentValue_Scroll(object sender, EventArgs e)
{
iAngularGaugeX1.Position = ComponentValue.Value / 100;
}
private void iAngularGaugeX1_OnCurrentMaxChange(object sender, EventArgs e)
{
MaxEventText.Text = iAngularGaugeX1.CurrentMax.ToString();
}
private void iAngularGaugeX1_OnCurrentMinChange(object sender, EventArgs e)
{
MinEventText.Text = iAngularGaugeX1.CurrentMin.ToString();
}
private void timer1_Tick(object sender, EventArgs e)
{
ComponentValue.Value = ComponentValue.Value Convert.ToInt32(new Random().NextDouble() * 501 - 250);
ComponentValue_Scroll(null,null);
}
private void SetStyle3_Click(object sender, EventArgs e)
{
iAngularGaugeX1.ArcRangeDegrees = 300;
iAngularGaugeX1.ArcStartDegrees = 240;
iAngularGaugeX1.PositionMax = 100;
iAngularGaugeX1.ShowHub = true;
iAngularGaugeX1.ShowOuterArcRadius = true;
iAngularGaugeX1.PointerStyle = isAnalogLibrary.TxiAngularGaugePointerStyle.iagpsLine;
iAngularGaugeX1.TickMajorCount = 11;
iAngularGaugeX1.TickMajorLength = 20;
iAngularGaugeX1.TickLabelPrecision = 0;
iAngularGaugeX1.TickMinorCount = 4;
iAngularGaugeX1.TickMinorLength = 8;
iAngularGaugeX1.TickMinorAlignment = isAnalogLibrary.TxiTickMinorAlignment.itmnaOutside;
iAngularGaugeX1.TickLabelMargin = -33;
iAngularGaugeX1.SectionCount = 4;
iAngularGaugeX1.SectionColor1 = System.Drawing.Color.White;
iAngularGaugeX1.SectionColor2 = System.Drawing.Color.Green;
iAngularGaugeX1.SectionColor3 = System.Drawing.Color.Yellow;
iAngularGaugeX1.SectionColor4 = System.Drawing.Color.Red;
iAngularGaugeX1.SectionEnd1 = 30;
iAngularGaugeX1.SectionEnd2 = 50;
iAngularGaugeX1.SectionEnd3 = 75;
iAngularGaugeX1.SectionEnd4 = 100;
iAngularGaugeX1.Label1Text = "温度";
iAngularGaugeX1.ShowLabel1 = true;
iAngularGaugeX1.Label1OffsetX = 0;
iAngularGaugeX1.Label1OffsetY = -30;
iAngularGaugeX1.Label2Text = "摄氏度";
iAngularGaugeX1.ShowLabel2 = true;
iAngularGaugeX1.Label2OffsetX = 0;
iAngularGaugeX1.Label2OffsetY = 23;
iAngularGaugeX1.MinMaxPointerStyle = isAnalogLibrary.TxiAngularGaugePointerStyle.iagpsLine;
iAngularGaugeX1.MinMaxPointerMargin = 15;
}
评论