using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace Caster
{
/// <summary>
/// MyMoveChar 的摘要说明。
/// </summary>
public class MyMoveChar : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Timer timer;
private System.Windows.Forms.Label label;
private System.ComponentModel.IContainer components;
public MyMoveChar()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();
timer.Tick+=new EventHandler(timer_Tick);
// TODO: 在 InitializeComponent 调用后添加任何初始化
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label = new System.Windows.Forms.Label();
this.timer = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// label
//
this.label.AutoSize = true;
this.label.Location = new System.Drawing.Point(320, 0);
this.label.Name = "label";
this.label.Size = new System.Drawing.Size(0, 17);
this.label.TabIndex = 0;
//
// timer
//
this.timer.Enabled = true;
//
// MyMoveChar
//
this.Controls.Add(this.label);
this.Name = "MyMoveChar";
this.Size = new System.Drawing.Size(320, 32);
this.ResumeLayout(false);
}
#endregion
#region propertys
public new System.Drawing.Size Size
{
get
{
return base.Size;
}
set
{
base.Size=value;
label.Location= new System.Drawing.Point(label.Location.X,(Size.Height-label.Size.Height)/2);
}
}
public override System.Drawing.Font Font
{
get
{
return base.Font;
}
set
{
base.Font=value;
label.Font=value;
}
}
public override String Text
{
get
{
return label.Text;
}
set
{
label.Text=value;
label.Location=new System.Drawing.Point(this.Size.Width,label.Location.Y);
}
}
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor=value;
label.ForeColor=value;
}
}
public override System.Drawing.Color BackColor
{
get
{
return base.BackColor;
}
set
{
base.BackColor=value;
label.BackColor=value;
}
}
public int Interval
{
get
{
return timer.Interval;
}
set
{
timer.Interval=value;
}
}
#endregion
private void timer_Tick(object sender, EventArgs e)
{
if((label.Location.X+label.Size.Width)>0)
label.Location=new System.Drawing.Point(label.Location.X-1,label.Location.Y);
else
label.Location=new System.Drawing.Point(this.Size.Width,label.Location.Y);
}
}
}
分享到:
相关推荐
c#滚动字幕c#滚动字幕
滚动字幕,C#编写
滚动字幕,小程序,可供借鉴,本程序由C#开发
C# 滚动字幕 实例源码(窗体技巧)
C#实现滚动字幕特效,C#实现滚动字幕特效
C#文字滚动,滚动字幕效果
C#实现滚动字幕完整源码
c# 实现滚动字幕效果源码,很简单使用的小技巧,重点是思路很简单,代码很少。
C#滚动字幕 如酷狗桌面透明屏幕字幕滚动 从右到左 C#滚动字幕 如酷狗桌面透明屏幕字幕滚动 从右到左
C#243滚动字幕源代码
Winform写的 自定义滚动字幕,可以设置滚动速度。目前是滚动到终点后原路返回到起点,有兴趣的同学可以修改代码实现更多的功能,在此抛砖引玉
C#滚动字幕 利用C#写的滚动字幕,可以实现自动循环播放,代码内容非常简单,但是相对简单,适合初学者
c# 写的程序界面滚动字幕,可实现在程序运行界面来回滚动。
C#源码,在屏幕下方显示悬浮滚动字幕,不影响软件正常的测试,在一些软件测试过程中,可作为一些提醒显示,防止误操作,但是又不影响软件正常进行
Winform中实现滚动字幕效果代码,
C#字幕滚动! 很值得下载看看!资源免费,大家分享!!
C#基于窗体内的滚动字幕文字滚动特效
C#实现滚动字幕完整源码.rar