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
Le Vo Quang
NA
3
0
How to stop code generator in designer in this case
Sep 1 2009 2:58 AM
I am creating a custom control derived from ComboBox. I add some items to custom control in constructor of control.
// this code is sample
public MyCustomControl
{
this.Items.Add("test1");
this.Items.Add("test2");
}
When I drag this custom control to my form, designer auto-generate the code:
// this code in Form1.Designer.cs
this.mycustomControls.Items.AddRange(new object[] {
"test1",
"test2"});
When this custom control display on Form1, will have 4 items:
test1
test2
test1
test2
This problem cause duplication.
Please help me how to solve this problem, I don't want designer auto-generate these codes. Thanks.
Reply
Answers (
1
)
Dotfuscator Renaming Problem
when to use abstract class and when to use interface?