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
Dadyar Salar
NA
64
9.8k
c# dispose user control on the panel
Jun 23 2020 1:45 PM
i have many user control when i click on my menus button it shows that user control i want but i was looking on GDI objects on the task manager i found that when i go to another user control the GDI of the previous user control not relaesed and not dispose it is my code for adding user control to panel and dispose any user control on that panel before adding new user control:
void
showControl(Control control)
{
for
(
int
ix = tlp4.Controls.Count - 1; ix >= 0; --ix)
{
var ctl = tlp4.Controls[ix];
ctl.Dispose();
}
tlp4.BringToFront();
control.Dock = DockStyle.Fill;
tlp4.Controls.Add(control);
control.Focus();
tableLayoutPanel2.Visible =
false
;
tlp4.Visible =
true
;
}
Reply
Answers (
0
)
Error when consuming SOAP Web service
input item name from textbox with wildcard character * to fetch match