I have a C # Winform application. In my form, I have a panel, and in my panel I have a shortcut. The label is created dynamically. I have the following code:
Label label1 = new Label();
label1.MaximumSize = new Size(400, 0);
label1.Location = new Point(posX, posY);
label1.Text = myText;
label1.AutoSize = true;
posY += 15;
Ok, everything works. Tag text is automatically wrapped after 400 pixels. The problem is that I need to create a second shortcut, but how do I know how to set the location? This new label should be placed just below the first label, and the first label can be 1 line or 5 lines long. Any help would be appreciated.
source
share