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
Gustavo
NA
1.3k
455.3k
How Do I: Get rid of redundant code? (Put in a userControl?) Part 2:
Apr 1 2010 12:13 PM
Hello:
I have tried for two days now. I still can not get it to work. I have the following code that I have in every form. I would like to put it in one place and include it in all my forms. Like the C+ with the #include. Can someone give me a sample of how I can do it?
public
FormICEPack()
{
InitializeComponent();
Control
TheControl = GetNextControl(
null
,
true
);
while
(TheControl !=
null
)
{
if
(TheControl.GetType().Name ==
"TextBox"
)
{
TheControl.Enter +=
new
EventHandler
(Object_Enter);
TheControl.Leave +=
new
EventHandler
(Object_Leave);
//TheControl.Click += new EventHandler(Object_Click);
TheControl.MouseHover +=
new
EventHandler
(textBox_MouseHover);
TheControl.MouseLeave +=
new
EventHandler
(textBox_MouseLeave);
}
TheControl = GetNextControl(TheControl,
true
);
}
}
Reply
Answers (
10
)
C#.NET Windows Write Excel From Last Position
How use custom serialization?