Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6561649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:36:48+00:00 2026-05-25T13:36:48+00:00

I have a (problem?) where my application’s main form code is becoming quite large.

  • 0

I have a (problem?) where my application’s main form code is becoming quite large. Because it is the main section of the app, there are a ton of event handlers.

I really don’t want to use partial classes to separate sections of the code because I might as well just use regions then. Also partial form classes don’t show up in the designer and are in general just confusing.

Not really sure what to do to be honest. The file is around 1,000 lines of code while all my other classes are 10-150 lines each. I can’t really encapsulate the behavior in to other objects because most of the event handlers manipulate controls on the form or member variables of the class and doing so would require a lot of parameter passing and confusion.

Trying to think of a possible course of action. I really would like to encapsulate a lot of the behavior in to other classes but the problem is the event handlers modify private controls and member variables. These classes would need to somehow have access to this data but I’d rather not just give an instance of the form to the class and make all the controls and member data public >.>

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:36:49+00:00Added an answer on May 25, 2026 at 1:36 pm
    1. Break it down into user controls.
    2. Make sure there’s nothing in the form that is not about presentation (display to the user, collection of user input). Move all data access out into separate classes, and the same for business logic.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem in writing the code in windows form application my problem is
I have problem with my application. I have table report, there are 2 column
I Have a Problem for view Application Reports in XBAP Partail Trust . because
i have next problem in my application, i write app where someone will write
i have problem using camera in my Android application i have a form for
A have a problem with PHP application, that I'm working on. Main page which
I have this problem: My web application has a form where the users can
I have problem with Stripes forms in the application for Google App Engine. I
I have a problem with an application which uses the same stored procedure over
I have a problem linking an application for an embedded target. I'm developing on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.