private void BUT_detbutton_Click(object sender, EventArgs e) { string name = ((MyButton)sender).Name.Replace("mybut", ""); ComboBox cmb = (ComboBox)(this.Controls.Find("cmbbutton" + name, false)[0]); cmb.Text = Joystick.getPressedButton(CMB_joysticks.Text).ToString(); }