Hi Looksharp,
Thanks for the interest in Syncfusion products.
You can calculate the width of each button and set the size of the toolstripex. Please refer the code
snippet that shows how you can calculate and set the size of the toolstripex.
int width = 0;
int tWidth = 0;
int i,j=0;
foreach (ToolStripPanelItem panel in this.toolStripEx1.Items)
{
foreach (ToolStripButton button in panel.Items)
{
width += button.Size.Width;
}
int w = width/panel.Items.Count;
if(panel.RowCount== panel.Items.Count)
{
tWidth = w;
}
else
{
i = panel.Items.Count/panel.RowCount;
j= panel.Items.Count% panel.RowCount;
if(j==0)
{
tWidth = w*i;
}
else
{
tWidth=w*(i+1);
}
}
}
this.toolStripEx1.Size = new Size(tWidth+15 , toolStripEx1.Size.Height);
Please refer the sample in the below link that illustrates the above.
rel='nofollow' href="http://websamples.syncfusion.com/samples/Tools.Windows/41455_1/main.htm">http://websamples.syncfusion.com/samples/Tools.Windows/41455_1/main.htmPlease let me know if you have any questions.
Regards,
Asem.