How to write such code into a function so that you can call it from the button's processing method
int x = Convert.ToInt32(textBox1.Text); string bin = Convert.ToString(x, 2); label3.Text = bin; What did i mean
public static string perevod(int val) { string res = Convert.ToString(val, 2); return res; } private void button1_Click(object sender, EventArgs e) { int val = Convert.ToInt32(textBox1.Text); string res = perevod(val); label3.Text = perevod(val); }