Category / Section
How to change the size of the ToolStripButton image in the ToolStripEx?
1 min read
Change the size of ToolStripButton
You can change the size of the ToolStripButton image by using the property, ImageScalingSize in the ToolStripEx. It helps to specify the image size used in the ToolStripEx. In order to specify the ImageScalingSize for ToolStripEx, the ImageScaling property should be specified as SizeToFit in the ToolStripButton.
C#
//Changes the size of the ToolStrip botton image this.toolStripEx1.ImageScalingSize = new Size(60, 60); //Disables the image scaling for a particular item this.toolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
VB
'Changes the size of the ToolStrip botton image Me.toolStripEx1.ImageScalingSize = New Size(60, 60) 'Disables the image scaling for a particular item Me.toolStripButton2.ImageScaling = ToolStripItemImageScaling.None
Note:
1. The Image scaling size is specified as pixels.
2. The default value of the ImageScaling size is 16 x 16 pixels.
3. The default value of the ImageScaling property is SizeToFit.
Figure 1: Before specifying the ImageScaling size
Figure 2: After specifying the ImageScaling size
Figure 3: Image scaling is disabled for ToolStripButton2