Hey guys,
I thought I understood storing variables I will be calling frequently into classes down pat, but this just isn't playing nicely.
The purpose is because I have a TON of if statements that will use this same call here and if I ever want to change it I don't want to have to go through each one to alter it. I know I can do it in a seperate class, but I am failing here. One thing I think my problem is, is that I am calling a class, within a class maybe? I don't see a way around this. Here is how I am trying to call itCode:Class Paramaters { Public DateTime time = DateTime.Now; public string formatDate = "MM/dd"; }
Seems too simple to be true. Thanks for the help.Code:private void Form1_Load(object sender, EventArgs e) { textBox1.Text = Parameters.time.ToString(Parameters.formatDate); }




Reply With Quote