Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

How can I have constants accessible from any part of my application?

Hi,

I need to have some constants in my application that I can access from any form within the application.

Thanks.
0
EEssam
Asked:
EEssam
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
create a static class with static members:

public static class MyConstants
{
     public static float PI = 3.1416;
}

So you can access as MyContants.PI
0
 
EEssamAuthor Commented:
Thank you so much. You are very helpful.




0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now