列表框再次出现问题

编程入门 行业动态 更新时间:2024-10-10 09:17:05
本文介绍了列表框再次出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

谁能帮忙? 我有一个带有一些名称的列表框(数据源在代码中分配) listbox1 格里 汤姆 鲍勃 艾丽莎 麦当娜 德雷尼 梅尼 Geni 因此,当我单击一个仅向我显示列表框中前四个成员的按钮时,如何使用其他列表或用于示例...该列表也应类似于MessaggeBox 因此,在消息框或另一个仅是前四个成员的列表框中,例如: 格里 汤姆 鲍勃 艾丽莎 thnx

who can help please? I have a listbox with some names (datasource is assigned in code) listbox1 Gery Tom Bob Alisa Madona Dreni Meni Geni so how can i use another list or for exampl when I clik in a button that show me only first four members in listbox... that list should be also like MessaggeBox so in messagge box or another listbox that be only the first four member like: Gery Tom Bob Alisa thnx

推荐答案

尝试一下: try this : string msg = string.Empty; for(int i=0;i<4;i++) { msg+=(string)listbox1.Items[i] + "\n"; } MessageBox.Show("The first four items :\n" + msg);

更多推荐

列表框再次出现问题

本文发布于:2023-10-27 23:50:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1534889.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!