private void menu_Click(object sender, EventArgs e) { if (MessageBox.Show(string.Format("Confirm the player action {0}", ((MenuItem)sender).Tag), "Confirm the player action", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { string response = rconServerProxy.SendCommand(((MenuItem)sender).Tag.ToString()); AddCommandToHistoryList(((MenuItem)sender).Tag.ToString()); AddServerResponseText(txtResponse, response); } }