求助c#信息公布系统该用什么控件

C#初学者1 2019-06-11 04:24:26
我想做一个连接SQL Server的一个表,将表里面的信息公布到大屏幕上,数据上下滚动显示,给大家看的,求助高手指导该用什么控件呢?datagridview吗?还是listview?大概方案是什么,本人是初学者,还请大师指导方案,谢谢!
...全文
538 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
amouslion 2019-06-13
  • 打赏
  • 举报
回复
datagirdview,进行数据展示就行。该容器功能强大。
ManBOyyy 2019-06-13
  • 打赏
  • 举报
回复
引用 11 楼 C#初学者1 的回复:
[quote=引用 8 楼 一个武小猴子的回复:]这个公布到前端的数据 只需要套取一个前端框架就可以了。看你用什么前端框架了,这个效果很简单的,很多框架都已经封装好的。

c#初学者,还有很多不懂的[/quote]
是不是winfrom的
wilson1966 2019-06-13
  • 打赏
  • 举报
回复
不错,注记一下,以后可用
OrdinaryCoder 2019-06-13
  • 打赏
  • 举报
回复
这种问题还是要看用什么技术吧 是web还是Winform 或者是WPF
web h5+js
winform 好像是listview(没怎么用过winform )
WPF listview就OK
鱼有个梦想 2019-06-13
  • 打赏
  • 举报
回复
引用 楼主 C#初学者1的回复:
我想做一个连接SQL Server的一个表,将表里面的信息公布到大屏幕上,数据上下滚动显示,给大家看的,求助高手指导该用什么控件呢?datagridview吗?还是listview?大概方案是什么,本人是初学者,还请大师指导方案,谢谢!
DataGridView将所指定的数据库的内容添加到DataGridView的.text
qq14923349 2019-06-13
  • 打赏
  • 举报
回复
listboxlistboxlistboxlistboxlistboxlistboxlistbox
wpw401160 2019-06-13
  • 打赏
  • 举报
回复
或者用listview控件
一个武术猴子 2019-06-12
  • 打赏
  • 举报
回复
这个公布到前端的数据 只需要套取一个前端框架就可以了。看你用什么前端框架了,这个效果很简单的,很多框架都已经封装好的。
EdsionWang 2019-06-12
  • 打赏
  • 举报
回复
ManBOyyy 2019-06-12
  • 打赏
  • 举报
回复
簡單做了一個
DataTable dtTmpSource = new DataTable();
DataTable dtSource = new DataTable();
private void Form3_Load(object sender, EventArgs e)
{

DataTable dt = new DataTable();
dt.Columns.Add("1");
for (int i = 0; i <20; i++)
{
dt.Rows.Add(i.ToString());
}
dtTmpSource = dt;
dtSource = dt;
this.dataGridView1.DataSource = dt;

}

private void timer1_Tick(object sender, EventArgs e)
{
//label1.Left = label1.Left + 10;
//if (label1.Right > this.Width)
// label1.Left = 0;

int index = this.dataGridView1.FirstDisplayedScrollingRowIndex;
this.dataGridView1.Rows[index].Selected = true;  // 设置为选中.
this.dataGridView1.FirstDisplayedScrollingRowIndex++; 
        //如果数据太少.就不滚动 
if (index == this.dataGridView1.FirstDisplayedScrollingRowIndex) 
           { 
              return; 
           } 
           //将刚才定位的数据插入到dtSource的末尾.这是为了实现循环滚动. 
           dtSource.ImportRow(dtSource.Rows[index]); 
            //rowCount为记录总数 
if (this.dataGridView1.FirstDisplayedScrollingRowIndex > dataGridView1.RowCount - 1) 
            { 
            //初始时,将数据取出同时放在dtSource   与dtTmpSource中, 
            //现在dtSource中,已增加了很多数据. 
           //因而在所有原数据都遍历完,开始下一次遍历时,将原数据覆盖现在的dtSource   ; 
            dtSource   =   dtTmpSource;
this.dataGridView1.FirstDisplayedScrollingRowIndex = 0; 
            } 


// this.dataGridView1.FirstDisplayedScrollingRowIndex = this.dataGridView1.Rows.Count - 1;
           

}
C#初学者1 2019-06-12
  • 打赏
  • 举报
回复
引用 8 楼 一个武小猴子的回复:
这个公布到前端的数据 只需要套取一个前端框架就可以了。看你用什么前端框架了,这个效果很简单的,很多框架都已经封装好的。
c#初学者,还有很多不懂的
C#初学者1 2019-06-12
  • 打赏
  • 举报
回复
引用 6 楼 ManBOyyy的回复:
簡單做了一個
DataTable dtTmpSource = new DataTable();
DataTable dtSource = new DataTable();
private void Form3_Load(object sender, EventArgs e)
{

DataTable dt = new DataTable();
dt.Columns.Add("1");
for (int i = 0; i <20; i++)
{
dt.Rows.Add(i.ToString());
}
dtTmpSource = dt;
dtSource = dt;
this.dataGridView1.DataSource = dt;

}

private void timer1_Tick(object sender, EventArgs e)
{
//label1.Left = label1.Left + 10;
//if (label1.Right > this.Width)
// label1.Left = 0;

int index = this.dataGridView1.FirstDisplayedScrollingRowIndex;
this.dataGridView1.Rows[index].Selected = true;  // 设置为选中.
this.dataGridView1.FirstDisplayedScrollingRowIndex++; 
        //如果数据太少.就不滚动 
if (index == this.dataGridView1.FirstDisplayedScrollingRowIndex) 
           { 
              return; 
           } 
           //将刚才定位的数据插入到dtSource的末尾.这是为了实现循环滚动. 
           dtSource.ImportRow(dtSource.Rows[index]); 
            //rowCount为记录总数 
if (this.dataGridView1.FirstDisplayedScrollingRowIndex > dataGridView1.RowCount - 1) 
            { 
            //初始时,将数据取出同时放在dtSource   与dtTmpSource中, 
            //现在dtSource中,已增加了很多数据. 
           //因而在所有原数据都遍历完,开始下一次遍历时,将原数据覆盖现在的dtSource   ; 
            dtSource   =   dtTmpSource;
this.dataGridView1.FirstDisplayedScrollingRowIndex = 0; 
            } 


// this.dataGridView1.FirstDisplayedScrollingRowIndex = this.dataGridView1.Rows.Count - 1;
           

}
感谢大师分享,拿回来研究下🙏
C#初学者1 2019-06-12
  • 打赏
  • 举报
回复
引用 7 楼 EdsionWang的回复:
js实现滚动 https://blog.csdn.net/waterDjj/article/details/52022081
感谢你,可惜我还不会,初学者,只会#
C#初学者1 2019-06-11
  • 打赏
  • 举报
回复
引用 4 楼 ManBOyyy的回复:
[quote=引用 3 楼 C#初学者1 的回复:]
[quote=引用 1 楼 ManBOyyy的回复:]就textbox或者lable就行了吧
滾動的
private void timer1_Tick(object sender, EventArgs e)
{
label1.Left = label1.Left + 10;
if (label1.Right > this.Width)
label1.Left = 0;



label2.Top = label2.Top + 10;

if (this.label2.Bottom > this.Height)
label2.Top = 0;
}

这两个控件能显示表格数据吗?表格里好多数据,4-5列,上百行啊?[/quote]
那還是用datagridview把[/quote] 大师,能告诉下我,怎么能让数据上下滚动显示信息呢?
ManBOyyy 2019-06-11
  • 打赏
  • 举报
回复
引用 3 楼 C#初学者1 的回复:
[quote=引用 1 楼 ManBOyyy的回复:]就textbox或者lable就行了吧
滾動的
private void timer1_Tick(object sender, EventArgs e)
{
label1.Left = label1.Left + 10;
if (label1.Right > this.Width)
label1.Left = 0;



label2.Top = label2.Top + 10;

if (this.label2.Bottom > this.Height)
label2.Top = 0;
}

这两个控件能显示表格数据吗?表格里好多数据,4-5列,上百行啊?[/quote]
那還是用datagridview把
C#初学者1 2019-06-11
  • 打赏
  • 举报
回复
引用 1 楼 ManBOyyy的回复:
就textbox或者lable就行了吧
滾動的
private void timer1_Tick(object sender, EventArgs e)
{
label1.Left = label1.Left + 10;
if (label1.Right > this.Width)
label1.Left = 0;



label2.Top = label2.Top + 10;

if (this.label2.Bottom > this.Height)
label2.Top = 0;
}
这两个控件能显示表格数据吗?表格里好多数据,4-5列,上百行啊?
wanghui0380 2019-06-11
  • 打赏
  • 举报
回复
投屏的用H5+js就好,那个只讲显示效果,不管业务逻辑。当然你用H5+js就成。 这种东西,都不用管数据库不数据库的,让前端先把UI实现都行
ManBOyyy 2019-06-11
  • 打赏
  • 举报
回复
就textbox或者lable就行了吧
滾動的
private void timer1_Tick(object sender, EventArgs e)
{
label1.Left = label1.Left + 10;
if (label1.Right > this.Width)
label1.Left = 0;



label2.Top = label2.Top + 10;

if (this.label2.Bottom > this.Height)
label2.Top = 0;
}

110,534

社区成员

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

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

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