你如何将图像添加到TabControl的在的WinForms标签? [英] How do you add an image to TabControl's label in Winforms?

查看:348
本文介绍了你如何将图像添加到TabControl的在的WinForms标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么一个图像添加到选项卡标签上的标签控件



就像这样:



但是,一个正常的标签页上这样的:



我明白要做到这一点,你需要一个添加图像列表,使要使用的图像的索引,但我还没有发现任何的例子在谷歌搜索。任何帮助吗?


解决方案

  1. 添加一个ImageList控件到窗体(这应该是工具箱)。通过转到属性选项卡添加到图像列表中选择所需的图像,并设置图像属性


  2. 然后到选项卡控件的属性。并在ImageList属性中选择您在上一步中创建的图像列表,然后在的TabPages属性打开标签页集合编辑器(点击按钮)选择一个页面,那么你要的ImageIndex属性设置为指数从图像列表中的图像。



  3. How do you add a image to a tab label on a tab control?

    Just like this:

    But on a normal tab page like this:

    I understand to do this you need to a add a Imagelist and make a index of the images to be used but I haven't found any examples searching on google. Any help?

    解决方案

    1. Add an ImageList control to the form (this should be in the Toolbox). Add the images you want to the image list by going to the properties tab and set the Images property.

    2. Then go to the properties for the tab control; and in the ImageList property select the image list you created in the previous step, then in the TabPages property open up the Tab Page Collection Editor (by clicking the button) select a page, then you want to set the ImageIndex property to the index of the image from the image list.

    这篇关于你如何将图像添加到TabControl的在的WinForms标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆