Hi Andy
Here is a sample that demonstrates what you are looking for.
- You need to set the Minimumsize proprty for the Form.
- For the FlowLayout component, you need to set the LayOutMode to be Vertical and you also need to provide LeftMargin and RightMargin:.
- To autosize the label control when you increase/decrease the form width, you need to listen to the FlowLayout''s ProvideLayoutInformation event to set the PreferredSize for the Label control.
You have to do this because the .NET label contrOl does not have a concept of PreferredSize.
private void flowLayout1_ProvideLayoutInformation(object sender, Syncfusion.Windows.Forms.Tools.ProvideLayoutInformationEventArgs e)
{
if (e.Control == this.label1 && e.Requested == LayoutInformationType.PreferredSize)
{
Graphics g = this.CreateGraphics();
SizeF szPref = g.MeasureString(this.label1.Text, this.label1.Font, this.ClientRectangle.Width);
e.Size = new Size(this.ClientRectangle.Width-20, (int)szPref.Height + 5);
e.Handled = true;
g.Dispose();
}
}
Regards
Arun