private void button1_Click(object sender, EventArgs e) { Class1 cl; cl = new Class1(); string date = cl.GetDate(); string time = cl.GetTime(); MessageBox.Show(date + " " + time); }