Hello,
I get 2 strange effects using the appended small sample.
The Code has a main form and a button. Using the button, by code I create a new label (with incremented text) and dock it on the left side of the form.
So that after some click I get labels ordered : 987654321 were I expect to read 123456789.
2. After some button clicks the program is no more responsive. Clicking the button does nothing, even placing a break point in the code.
The count of labels you are able to create is related to the width of the created label. Reducing it’s width allows to get some more created before becoming unsresponsive.
NB:
If a label is first docked on top, it will also be pushed to the right at each creation.
Same behavior for all major browsers.
Regards.
Luca,
I didn’t knew that Z-order story, thanks for this training :).
For point 2 the solid border makes it obvious (the height of the control is the docked height !!).
Now it works like a charm 🙂
For other users interested by the case, see the remark about the placement of this.Controls.SetChildIndex(Lbl1, 0)
private void button1_Click(object sender, EventArgs e)
{
Label Lbl1 = new Wisej.Web.Label();
Lbl1.Text = BtnIdx.ToString();
Lbl1.BorderStyle = BorderStyle.Solid;
Lbl1.Dock = DockStyle.Left;
this.Controls.Add(Lbl1);
//Needs to be ordered AFTER adding to avoid error ‘child’ is not a child control of this parent.
this.Controls.SetChildIndex(Lbl1, 0);BtnIdx += 1;
}Thanks… Super support, super product, long life to both.
Hi Eric,
I run the sample and it looks correct. You can try the same in WinForms. This is what happens:
HTH
/Luca
Please login first to submit.