I have this problem that my panel object is drawn above an runtime created object...
It's really annoying so my question is:
Is there a way to change the order to display the objects?
If you want code just ask.
-Christopher
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Christopher AnonymusPosted Jun 11, 2010, 1:06 PM
Jaish MathewsPosted Jun 11, 2010, 11:41 AM
I added a button control to a Panel without any problem like below. I could able to attach an event too.
Try this way...
Button b1 = new Button();
b1.Text = "Dynamically Created";
b1.Name = "Dynamic1";
b1.Click+=new EventHandler(b1_Click);
b1.BackColor = Color.Silver;
panel1.Controls.Add(b1);
Need to set each property of the dynamic button. Otherwise it may take that specific property value from Panel i.e. from it's container.
Christopher AnonymusPosted Jun 11, 2010, 10:57 AM
PJ MartinsPosted Jun 6, 2010, 12:39 PM
Christopher AnonymusPosted Jun 6, 2010, 10:42 AM
Thanks for the answer.
PJ MartinsPosted Jun 5, 2010, 7:03 PM