TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shankar M
NA
3k
3.3m
Using Statement
Jan 30 2014 12:23 AM
Dear Experts,
I am using "using" statements to create labels dynamically.So the objects can be disposed after added to flow layout panel. Here is my code.
The problem is the control created are not added to the flow layout panel.
Code :
for (int j = 0;j<10 ; j++)
{
using (Label lbl = new Label())
{
lbl.Text = "Label" + j.ToString();
lbl.Name = "Label" + j.ToString();
lbl.Font = new Font("verdana", 6.0f);
lbl.Size = new Size(43, 8);
//lbl.Click +=new EventHandler(lbl_Click);
//flowLayoutPanel1.Margin = new Padding(0, 0, 0, 0);
//flowLayoutPanel1.Padding = new Padding(0, 0, 0, 0);
this.flowLayoutPanel1.Controls.Add(lbl);
}
}
Any help appreciated.
Thanks, Shankar M
Reply
Answers (
4
)
How change skins in design mode Ribbon of Developer Express
Hide the name of .aspx page