private void OnColorClick(object sender, EventArgs e) { ColorInputDialog inputDialog = new ColorInputDialog(); inputDialog.ShowDialog(); pnlColor.BackColor = inputDialog.GetColor(); }