namespace WinFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public class class1 { private string con; public string? CON { get { return this.con; } set { this.con = value; } } } private void button1_Click(object sender, EventArgs e) { class1 test = new class1(); test.CON = "2"; } private void button2_Click(object sender, EventArgs e) { class1 test2; string value = test2.CON.; } } }