?
Solved

Having separate classes for tabbed pages in Visual C#

Posted on 2007-10-17
5
Medium Priority
?
214 Views
Last Modified: 2013-12-17
Hi Experts,

When I create GUI in C#( Visual Studio 2005), all the code goes to the same main class.  Say, my GUI has multiple Tabbed pages, how can I have different classes for each pages?
0
Comment
Question by:ambuli
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20095973
You wouldn't need separate classes, since you can share the same event handlers for all the instances of the TabPage objects.

Bob
0
 

Author Comment

by:ambuli
ID: 20095999
Yes, but when my GUI comprised of lot of buttons and other stuffs the class is getting really big.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20096016
Have you heard about the Model-View-Controller (MVC) or Model-View-Presenter (MVP) patterns?

Bob
0
 

Author Comment

by:ambuli
ID: 20096058
I am familiar with MVC pattern. What I did was to use the Visual Studio to create a Windows Form project.  So, it created the form and class.  Then I added tabbed pages, buttons etc to that form.  Now, what I have is a class with many functions... So, I think it is not right thing to do
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 750 total points
ID: 20096078
In MVC, the form is the View and the model would be a state class that would hold the values that you need to store for the view to display.  The controller can be defined in the form, and not a separate class to simplify the event model required to bridge the model with the view.

Bob
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question