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
Naredla Nithesh
NA
328
78.8k
repositioning of controls in a panel control
Apr 23 2014 1:17 AM
hi friends this is my code but in this when i click on my delete button(this is also present in TimerUserControl) ,TimerUserControl will delete from the panel control list and remaining all controls are repositioned from top to bottom ...and i am unable to catch the index position of deleted TimerUserControl
private void btnAddTimer_Click(object sender, EventArgs e)
{
TimerUserControl obj_TimerUserControl = new TimerUserControl();
obj_TimerUserControl.Name = "Timer" + count;
obj_TimerUserControl.Location = new Point(5, count * 200);
obj_TimerUserControl.Size = new Size(540, 180);
bodyPanel.Controls.Add(obj_TimerUserControl);
obj.Add(obj_TimerUserControl);
count++;
MessageBox.Show(obj_TimerUserControl.Name.ToString());
}
private void bodyPanel_ControlRemoved(object sender, ControlEventArgs e)
{
TimerUserControl tim = (TimerUserControl)sender;
int index = obj.IndexOf(tim);
for (int i = index; i < obj.Count; i++)
{
obj[i].Location = new Point(5, i * 200 - 200);
}
}
Reply
Answers (
1
)
Generation ID Number and Letter in C # Code
word using C#