TabControl C# 中的图标 - 如何实现?
我似乎无法在任何地方找到这个问题的答案。 默认选项卡控件选项卡上的标签之前的图标就足以满足我的需求。
提前致谢。
问:您需要澄清您正在使用的库集:Winforms、WPF、ASP.Net、GTK# 等。 – Nathan Ernst
答:您完全正确,我的错误。我正在使用Winform。我从 WPF 切换回来,因为 WPF 在某些计算机上崩溃了。
I can't seem to find an answer for this anywhere.
An icon before the label on the default tabcontrol tabs would suffice for my needs.
Thanks in advance.
Q: You need to clarify what library set you're using: Winforms, WPF, ASP.Net, GTK#, etc. – Nathan Ernst
A: You are totally right, my mistake. I'm using Winforms. I switched back from WPF, since WPF was crashing in some computers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它是 TabControl 的内置功能。将 ImageList 放到表单上并用您的图标填充它。设置 TabControl.ImageList 属性。对于每个选项卡页,设置 ImageIndex 属性。
It is a built-in feature of the TabControl. Drop an ImageList on the form and fill it with your icons. Set the TabControl.ImageList property. For each tab page, set the ImageIndex property.
从 winform 的工具箱中拖放 imageList,然后从属性窗口将图像添加到集合中。添加选项卡控件并设置 TabControl.ImageList 属性。设置每个选项卡页的 ImageIndex 属性。请参阅示例 http://www.youtube.com/watch?v=D7E6xJyd6KM
Drag and drop an imageList from the toolbox on the winform and add images to collection from property window. Add a tabcontrol and Set the TabControl.ImageList property. Set the ImageIndex property for each tab page. see example http://www.youtube.com/watch?v=D7E6xJyd6KM