怎么样实现滚屏功能??

zhouabc 2005-01-04 10:16:58

直接在form窗体上显示滚动内容,还是在richtextbox中显示滚动内容,或者还有其它方法??
要可以控制滚动内容的字体大小.

请大侠指教.
...全文
162 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhouabc 2005-01-05
  • 打赏
  • 举报
回复
up
xiongchen 2005-01-05
  • 打赏
  • 举报
回复
上面是CSDN的问题,你复制到记事本看是对齐的.
或者用Align属性
xiongchen 2005-01-05
  • 打赏
  • 举报
回复
在文本之前插入空格啊
dskfljslflksdf
slfldskfljskfjlsfjlksfjlsfjklsfjl
dsfsfsfsdfsdfsdfsffs
sdfsdfsdfsfsfsdfsfsfsfsdfsfgfdgsbdfgfg
dsfsf
zhouabc 2005-01-05
  • 打赏
  • 举报
回复
如果用richtextbox显示来自数据库的内容好象不能象datagrid那样对齐.
xiongchen 2005-01-05
  • 打赏
  • 举报
回复
private void timer1_Tick(object sender, System.EventArgs e)
{
if(index >= count)
{
timer1.Enabled = false;
index = count = 0;
return;
}
index+=2;
richTextBox1.Select(index,0);
richTextBox1.ScrollToCaret();
}

private void richTextBox1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
index = 0;
count = richTextBox1.Text.Length;
timer1.Enabled ^= true;
}
这是个richTextbox滚动的代码,不知道是不是符合你的要求!
下面这段是Label滚动的代码

private void Form1_Load(object sender, System.EventArgs e)
{
this.timer1.Start();

}


private void timer1_Tick(object sender, System.EventArgs e)
{
this.timer1.Interval=1000;
if (this.label1.Location.Y<0)
{
this.label1.Location=new System.Drawing.Point(this.label1.Location.X,this.Height);
}
else
{
this.label1.Location=new System.Drawing.Point(this.label1.Location.X,this.label1.Location.Y-this.label1.Height-5);
}

}
zhouabc 2005-01-05
  • 打赏
  • 举报
回复
我是想在屏幕的某个区域上显示来自数据库的数据,数据可以自动平滑向上滚动,如何实现??

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧