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

  • SEARCH
  • Home
  • 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 8847215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:08:47+00:00 2026-06-14T12:08:47+00:00

I have 200+ UserControls on form1.cs (Winforms application) and confuse between event / method

  • 0

I have 200+ UserControls on form1.cs (Winforms application) and confuse between event / method / properties and enum of each UserControls which are not in proper order in form1.cs coding page.

I can order them by manually like set comment like // and by provide identity manually.

I want to know is there a different way to handle them by a specific method or any other way?

For Example:

namespace FinApps
{
public partial class Form1 : Form
{
    private FinAppsUserControl.ExportReports er;
    private FinAppsUserControl.BankMaster bankmaster;
    private FinAppsUserControl.CompanyMaster companymaster;

    public Form1()
    {
        er = new FinAppsUserControl.ExportReports();
        bankmaster = new FinAppsUserControl.BankMaster();
        companymaster = new FinAppsUserControl.CompanyMaster();

        InitializeComponent();

        this.panel2.Controls.Add(er);
        this.panel2.Controls.Add(bankmaster);
        this.panel2.Controls.Add(companymaster);

      bankmaster.BankMasterExitEvent += new FinAppsUserControl.BankMaster.bankmasterexitevent(bankmaster_BankMasterExitEvent);
        er.ExportReportsKeyDownEvent += new FinAppsUserControl.ExportReports.exportreportskeydownevent(er_ExportReportsKeyDownEvent);
        companymaster.CloseEvent += new FinAppsUserControl.CompanyMaster.closeevent(companymaster_CloseEvent);
     }


//below is mix event/properties/method not sorted by specific UserControl Order..

    private void er_ExportReportsKeyDownEvent(ref Message msg, Keys keydata)
    {
        if (keydata == Keys.Escape) 
        {
        // specific tasks          
        }
    }
 private void bankmaster_BankMasterExitEvent()
 {
      //specific tasks
 }

 private void companymaster_CloseEvent()
 {
        //specific tasks
 }

but I want to sort event/method/properties of Specific UserControl vide specific Usercontrol vise like below which I manually adjusted.

    //ExportReportUserControl
    private void er_ExportReportsKeyDownEvent(ref Message msg, Keys keydata)
    {
        if (keydata == Keys.Escape) 
        {
        // specific tasks          
        }
    }

   //BankMasterUserControl
 private void bankmaster_BankMasterExitEvent()
 {
      //specific tasks
 }

  //CompanyMasterUserControl

 private void companymaster_CloseEvent()
 {
        //specific tasks
 }

The above example are related to only three UserControl and there may about 200+ UserControls and each UserControls may be contain more Event/Method/Properties and Enum on Form1.cs coding page. I just want to sort them by specific UserControl Idenetity which I have manually declared above by comment //.

So my idea about to declare a specific method in form1.cs which is related to specific UserControls which contain individually their event/method/properties/enum and thus we can easily solve the above confusion.

Is it possible?. Or any other better way?.

  • 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-06-14T12:08:48+00:00Added an answer on June 14, 2026 at 12:08 pm

    You can use #region – #endregion tags, for example:

    #region MyUserControl1 things
    
    //Put your MyUserControl1 methods, event handlers etc. here
    
    #endregion
    
    #region MyUserContro2 things
    
    //Put your MyUserContro2 methods, event handlers etc. here
    
    #endregion
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that switches between usercontrols a lot, I want them to
I have 200 users each user will eventually have a reviewINFO table with certain
Currently in my iPhone application I have about 200 image views, and I will
I have a listview with 200 items. I use a custom view for each
I have a web application with over 200 configuration settings. These control everything from
I have an array which contains around 50-200 hyperlinks. How can I pass this
well, i have network that each proxy (lets assume we have 200 proxies), send
I have usercontrols which inherit a base class which looks like this: BasePage.cs: using
We just ported our WinForms application to WPF. However, performance decreased dramatically. We have
I have a database with 200 thousand student records, each student have an extendable

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.