I am not a professional programmer and trying to develop a desktop WinForms app using Visual Studio for my specific purpose. I made some search and after hours couldn't find an answer to my issue. Basically, I have hundreds of variables and methods in my WinForms program's Form1 class. All the code is in this Form1.cs page. But I came to a point I have to scroll crazy each time I try to reach a variable or a method. C# books and sites I looked at do not show such practical aspect.
For instance my Forms1.cs starts like:
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
int var_1 = 1;
//...
So as you see above, I have hundreds of variables such as var_1 inside Form1.cs. Now I want to move them to separate file so I created a class new called named Vars to the project and made the var_1 access modifier "public static" such as below:
namespace WindowsFormsApplication2
{
class Vars
{
public static int var_1 = 1;
//...
Now I deleted var_1 from Form1.cs and I can access var_1 in Form_cs typing as Var.var_1. But now I have thousands of variables I need to add "Var." before all of them in Form1.cs. Is there any way that I can directly access variables in this case without using "Var." but only using var_1 as in the first original case?