我要在窗体上面设置一个公告,公告上面的字希望是走马灯样式的.从右往左移动. 请大家指点下如何来实现.谢谢.
解决方案 »
- windows ce 里怎样绑定dataGrid
- Team foundation server
- 弹出窗口
- .net framework是否向下兼容啊?
- [4.0][Entity Framework][DataGridView]add时DataGridView无反应,但是Delete的时候正常刷新
- 第一次用C#,下了个源码,打开就出错!熟悉这方面的人指点哈.
- 一个文件I/O的问题。。各位大哥。。。
- 请问如何通过短信关闭计算机,能不借助短信猫或者m2p软件么?
- ODAC与oracle client的兼容性问题
- 关于framework的问题
- dateTimePicker绑定dategridview(立即给分)
- 高分求助rdlc报表的问题
bool flag = false;
private void button4_Click(object sender, System.EventArgs e)
{
this.textBox1.Text = "123456789";
i = 0;
Timer timer = new Timer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 100;
this.textBox1.Focus();
this.textBox1.Select(0,1);
timer.Start();
}
private void timer_Tick(object sender, System.EventArgs e)
{
if(this.i == this.textBox1.Text.Length )
{
this.flag = true;
}
if(this.i == 0 )
{
this.flag = false;
}
if(this.flag)
{
this.textBox1.SelectionStart = --i;
}
else
{
this.textBox1.SelectionStart = ++i;
}
}很简单,你可以试试
{
timer1.Enabled = true;
timer1.Interval = 500; // 零点五秒滚动一次
}private string strInfo = "滚动的文字 "; // 加适当的中文空格
private int pos = 0;
private void timer1_Tick(object sender, EventArgs e)
{
textBox1.Text = strInfo.Substring(pos) + strInfo.Remove(pos);
pos = (pos + 1) % strInfo.Length;
}