按钮列表?
我一直在开发一个小程序,它从网络服务器(最新的论坛主题)获取网址列表,并在创建新主题时警告用户。
所以我的程序的主窗体有一个按钮列表。每个按钮都有论坛主题的文本和下面的附加信息。当用户按下时,打开带有主题 url 的浏览器。
问题是,为每个主题创建按钮感觉不太好。我确信有更好的方法来为此程序创建用户界面。我尝试了列表视图,但我需要一些额外信息的空间,所以一行和一个文本大小不适合它。
编辑:抱歉,这是一个 Windows 窗体应用程序。
I've been working on a small program which gets a list of url's from the web server ( latest forum topics ) and warns the user whenever a new topic is created.
So the main form of my program have a list of buttons. Each button has the text of the forum topic and extra information below. Opens the browser with the topics url when user presses.
The problem is, creating buttons for every topic doesn't feel right. I'm sure there is a better way to create a user interface for this program. I tried listview but I need space for some extra information so one line and one text-size isn't good for it.
edit: I'm sorry, it's a windows form app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试ObjectListView。这是可以用它做的事情:
(来源:sourceforge.net)
Try ObjectListView. Here's what can be done with it:
(source: sourceforge.net)
对于这类事情,我会查看 WPF 并设置我自己的控件的样式。
For this sort of thing I would look at WPF and style my own controls.
您可以循环遍历它们并以编程方式添加按钮和标签。将它们垂直放置在彼此下方是简单的数学运算。
可能不是最佳实践,但它一直对我有用。
You can loop through them and add the buttons and labels programmatically. Placing them vertically below eachother is simple math.
Probably not best practice, but it has always worked for me.