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 7520735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:07:12+00:00 2026-05-30T02:07:12+00:00

In a WinForms application I’m working on I’d like to have a properties class

  • 0

In a WinForms application I’m working on I’d like to have a properties class to store common variables that all the forms in the project could access in order to store and retrieve values as required.

In the past I’ve used a static class to store strings and int values etc, but those are fixed during coding and cannot be altered when the application is running. I’d like to use a properties class in the same manner if its possible so that I’d have read and write functionality.

Must I create an instance of the properties class in Form1.cs and then pass it around as a parameter in the constructor of other forms in order for them to access the fields in the properties class?

Or can this be done without instantiation?

  • 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-30T02:07:13+00:00Added an answer on May 30, 2026 at 2:07 am

    If I’ve understood you correctly – you don’t need to do anything differently. You can change those while running.

    You can have:

    static class ForAll
    {
        public static int i;
    }
    

    And use it:

    ForAll.i = 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Winforms application that is working correctly on various versions of windows
I have a WinForms application that relies on a class library DLL. Inside the
I have a winforms application that normally is at about 2-4% CPU. We are
We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to
I have C# winforms application that needs to start an external exe from time
I have a winforms application that presently ships with a chm file for context-sensitive
In a WinForms application, I have a datagrid that is associated to a datasource.
I have a small WinForms application that sends notification emails. It works fine with
I have a WinForms application. That application have a rich functionality. It can create
i have a .net winforms application that i want to be soundless. occasionally when

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.