PDA

View Full Version : يه کلاس براي شبيه سازي عمل تگ marquee درhtml



aliprf
یک شنبه 07 تیر 1388, 12:07 عصر
يه کلاس براي شبيه سازي عمل تگ marquee درhtml
public class move_string
{
public move_string(string s,Control c)
{
str = s + " "; ;
control = c;
}
private string str = "";
private Control control;
private string set_move()
{
char[] ch = str.Substring(0, 1).ToCharArray();
string temp = str.Remove(0, 1);
temp += ch[0];
str = temp;
return str;
}
public void move()
{
Timer t = new Timer();
t.Interval = 150;
t.Tick += new EventHandler(t_Tick);
t.Start();
}
void t_Tick(object sender, EventArgs e)
{
control.Text= set_move();
}
}