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
454k
How Do I: Put this routine in a class?
Mar 31 2010 1:35 PM
Hello:
I have the following code in mty programs. I would like to put it in a class or something and just call it. So I can get rid of the redunda nt code in all my forms. Any suggestions?
I have tried to put it in a class, but it gives me an error on the 'GetNextControl'.
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 (
4
)
Why i am geeting this exception A device attached to the system is not functioning.
Event not fired, Com Object used inside c# windows service