Well I attempted to create labels next to each other but depending on the users input it can overlap the label beside it. I was wondering if theirs some sort of property that does not let the labels overlap.. I tried AutoSize = true method but I had no luck
The information was read from a xml file – they overlap horizontally
if (textReader.Name == "test")
{
textReader.Read();
XmlNodeType nType = textReader.NodeType;
if (nType == XmlNodeType.Text)
{
Label l = new Label();
System.Drawing.Point l1 = new System.Drawing.Point(15, 48 + a);
l.Location = l1;
l.Text = textReader.Value.ToString();
l.Size = new Size(200, 50);
tabPage2.Controls.Add(l);
a += 35;
}
}
You can use
AutoSizeto adjust width and height according to the text andMaximumSizeto auto-wrap the text, remaining text will go the next line if its width exceeds 200.