In the form designer added an ImageList and added an image to it. On the tab chose an image in ImageIndex. The image form constructor shows everything is ok:

Imgur

And in the runtime there is no image, although the tab has been stretched:

Imgur

The code does not affect ImageList or ImageIndex anywhere. What could be the problem?

  • check that the image file is copied to the destination folder when building the project if it is not integrated into the resources - rdorn
  • Try, without doing anything in the constructor, with the help of the form designer alone, bind ImageList to your tabControl (property ImageList) and then for each of the tabs, select the desired image for the ImageKey property from the ImageList property list. After that, everything will work for you. - Alexander Muksimov

0