I am creating a .NET form application in Visual Studio 9. In the designer I have added a MenuStrip to where I have added ToolStripMenuItems (standard dropdown menu). To the ToolStripMenuItems I have added images by setting the Image property.
The images appear as expected, except they are aligned to the left, even though the ImageAlign propery is set to MiddleCenter. Changing the ImageAlign to any value does not seem to have any effect on the alignment of the image.
What I want is to have the image aligned in the middle of the “image column” on the left side of the drop down menu. Is the ImageAlign property not supposed to do this?
This code sorta works:
The ultimate problem is that the layout of the menu item is calculated and internal. You can’t find out where the image ends and the text starts. The OnRenderItemImage() is sadly called without any hint how wide the image area is. Bit of a design goof there.