Icons in TabControl C# - How?

时间秒杀一切 提交于 2019-11-27 06:52:34

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/3663603/icons-in-tabcontrol-c-sharp-how

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!