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


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

Who is Participating?
Jaime OlivaresConnect With a Mentor Software 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
EEssamAuthor Commented:
Thank you so much. You are very helpful.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.