* UIScrollingText: 增加属性控制开启滚动
This commit is contained in:
parent
c588cec21f
commit
929a86b4b6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4
SunnyUI.Demo/Controls/FOther.Designer.cs
generated
4
SunnyUI.Demo/Controls/FOther.Designer.cs
generated
@ -179,6 +179,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiScrollingText2
|
// uiScrollingText2
|
||||||
//
|
//
|
||||||
|
this.uiScrollingText2.Active = true;
|
||||||
this.uiScrollingText2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiScrollingText2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
this.uiScrollingText2.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
this.uiScrollingText2.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
this.uiScrollingText2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
this.uiScrollingText2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||||
@ -191,7 +192,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiScrollingText1
|
// uiScrollingText1
|
||||||
//
|
//
|
||||||
this.uiScrollingText1.ClickPause = true;
|
this.uiScrollingText1.Active = true;
|
||||||
this.uiScrollingText1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiScrollingText1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
this.uiScrollingText1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
this.uiScrollingText1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||||
this.uiScrollingText1.ForeColor = System.Drawing.Color.Red;
|
this.uiScrollingText1.ForeColor = System.Drawing.Color.Red;
|
||||||
@ -347,7 +348,6 @@ namespace Sunny.UI.Demo
|
|||||||
// FOther
|
// FOther
|
||||||
//
|
//
|
||||||
this.AllowShowTitle = true;
|
this.AllowShowTitle = true;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
this.Controls.Add(this.uiSignal6);
|
this.Controls.Add(this.uiSignal6);
|
||||||
|
@ -45,16 +45,33 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
timer.Interval = interval;
|
timer.Interval = interval;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
timer.Start();
|
}
|
||||||
|
|
||||||
|
[DefaultValue(false), Description("是否滚动"), Category("SunnyUI")]
|
||||||
|
public bool Active
|
||||||
|
{
|
||||||
|
get => timer.Enabled;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
timer.Enabled = value;
|
||||||
|
if (!value)
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(false), Description("点击暂停滚动"), Category("SunnyUI")]
|
[DefaultValue(false), Description("点击暂停滚动"), Category("SunnyUI")]
|
||||||
public bool ClickPause { get; set; }
|
public bool ClickPause
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
private void Reset()
|
private void Reset()
|
||||||
{
|
{
|
||||||
XPos = int.MinValue;
|
XPos = int.MinValue;
|
||||||
XPos1 = int.MaxValue;
|
XPos1 = int.MaxValue;
|
||||||
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
~UIScrollingText()
|
~UIScrollingText()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user