c# Unable to set the size of the ToolStripStatusLabel?

2.5k Views Asked by At

In the toolstripstatuslabel, I'm adding images and displaying it as shown below.

Case 1: Setting the image list size [Not working]

Case 2: Setting the size of the label.[Not working]

In both the above cases, size is not getting reflected.

StatusStrip statusStrip = new StatusStrip();
//Set the size of the status bar
statusStrip.AutoSize = false;

ImageList imgList = new ImageList(); 

...Add resource images to image list

imgList.ImageSize = new System.Drawing.Size(50, 50);

//Set the images on the status strip
ToolStripStatusLabel add = new ToolStripStatusLabel();
add.Image = jobImgList.Images[0];

//Set auto size to false, so specify the size
add.AutoSize = false;
add.Size = new System.Drawing.Size(50, 50);

statusStrip.Items.Add(add);

Is there any other property that needs to be changed other than setting AutoSize to false!?

1

There are 1 best solutions below

0
Akaanthan Ccoder On

The solution is as simple as that!

statusStrip.ImageScalingSize = new Size(40, 40);

Reference: How to increase the size of the buttons on a tool strip?