if (System.Diagnostics.Debugger.IsAttached) { this.textBox1.Text = "debug"; } else { this.textBox1.Text = "NOdebug"; }