2

I have a user control with a checkbox. I am trying to make it visible in designer view of the parent form, but invisible on runtime.

The following code makes checkbox visible in user control's designer view, and invisible on runtime and parent's designer view:

    public ucInspectionParameter()
    {
        InitializeComponent();                     
        if (this.DesignMode == false) this.cbxVirtual.Visible = false;
    }

enter image description here

Vladimir Perković
  • 1,351
  • 3
  • 12
  • 30
  • 1
    The dsigne-time of your form is run-time of controls which are in your form. You can use `LicenseManager.UsageMode` and check if it's `LicenseUsageMode.Designtime` then you can say the control is in design mode like duplicate post. Don't forget to using `System.ComponentModel.` Also to know more about how the designer works take a look at [this post](http://stackoverflow.com/a/32299687/3110834). – Reza Aghaei Oct 07 '16 at 09:08

0 Answers0