Robinson Robinson - 1 year ago 79
C# Question

Can't select controls on my form

This has started happening recently (not too sure what caused the change unfortunately), but I can no longer select controls on my form. My reading on this has uncovered some possible explanations including:

  1. You're running your program in debug mode

  2. Your form is derived from another class where everything is private

  3. Your controls are "locked".

For (1), no, it's definitely not running and for (2) my form is derived from DevComponents.DotNetBar.RibbonForm. For (3), no, they're not "locked" (I tried locking and then unlocking, in case some state was stuck in the designer, but no dice). The controls are on my form, not the base class form and the instances aren't private (I deliberately made them public just to test this one) and they were working fine before.

So, what can I do? I can select a control, like a ComboBox, from the Properties window drop-down list, change its properties and so on. But when I choose it nothing gets selected in the designer. I can select the form itself (by its border) and resize it in the designer. I can add a new control, like a label, and interact with it fine in the designer, so this is something that's happened to my existing controls.

I'm sure it's either something spectacularly dumb, or Visual Studio 2012 is on the wind-up.


Edit: Zipped the solution up and brought it home. Cleaned and rebuilt and it's working fine in the designer. I guess there's an issue with my install at work, somehow.

Answer Source

Well, I kind-of solved the problem, although I don't know what the actual cause was. In my program I'm referencing devcomponents.dotnetbar dll. I removed the reference and then re-added it, rebuilt the program and now everything's working in the designer as it should.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download