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
Vigo Vigo
NA
6
2.1k
Application.OpenForms encapsulation
Jun 21 2015 3:26 PM
Is there any way to encapsulate this function in a static class?
private void btnAddWorker_ItemClick(object sender, ItemClickEventArgs e)
{
bool isOpen = false;
foreach (Form _f in Application.OpenForms)
{
if (_f is frmAddWorker)
{
isOpen = true;
_f.Focus();
break;
}
}
if (isOpen == false)
{
frmAddWorker AddWorker = new frmAddWorker() { MdiParent = this };
AddWorker.Show();
}
}
something like that:
public class Forms(){public void openForm(form _f){...}}
I want to prevent write the original code in all forms buttons that open.
Thanks
Reply
Answers (
1
)
scan barcode in textbox.
public class vs class