Using system;
Using system. collections;
Using system. componentmodel;
Using system. drawing;
Using system. Data;
Using system. Windows. forms;
Namespace caster
{
/// <Summary>
/// Summary of 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 ()
{
// This call is required by the windows. Forms Form Designer.
Initializecomponent ();
Timer. Tick + = new eventhandler (timer_tick );
// Todo: add any initialization after initializecomponent calls
}
/// <Summary>
/// Clear all resources in use.
/// </Summary>
Protected override void dispose (bool disposing)
{
If (disposing)
{
If (components! = NULL)
{
Components. Dispose ();
}
}
Base. Dispose (disposing );
}
# Code generated by the region component designer
/// <Summary>
/// The designer supports the required methods-do not use the code editor
/// Modify the content of this method.
/// </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)
Labels. 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 );
}
}
}