locked
Problem with user controls RRS feed

  • Question

  • I'm working on a project which, among others, consists of a user control and a form which incorporates it. Everything has been working fine, until I added a bunch of checkboxes to the control. From then, every time I try to run the project (after building it), the form can't show because it's designer cant instantiate the user control on it. Everything is OK with the code on the form and on the user control, but the problem persists after rebuilding.
    It only goes away after I delete the damn checkboxes, but I need them for a piece of functionality, so I'd rather not do that. Can you please help me?
    Tuesday, July 3, 2007 10:15 AM

Answers

  • Well obviously there isn't a valid reason why checkboxes can't be on the control. So something else has to be going on.

     

    What have you tried so far? Can you add different types of controls and just not checkboxes? Did you try to delete the control from the form, add the checkboxes to the control, and then rebuild and readd the control to the form?


    Another thing you could try is deleting your obj directory (and the exe/dll files out of the bin folder) I have seen sometimes where VS keeps using a cached copy of compiled code, and it screws things up, or makes changes not show.

    Tuesday, July 3, 2007 1:38 PM
    Moderator
  • Be sure to run the Clean Application function from the Build menu.

     

    Also, click the Show All Files button on the solution explorer and examine the .designer.vb files for the component, and more importantly the form.  You may find errors in here that need to be corrected manually. 

     

    -Edit-

    You may also need to completely remove the control from the form in the designer and then add it back.

    Wednesday, July 4, 2007 3:24 AM
    Moderator

All replies

  • Well obviously there isn't a valid reason why checkboxes can't be on the control. So something else has to be going on.

     

    What have you tried so far? Can you add different types of controls and just not checkboxes? Did you try to delete the control from the form, add the checkboxes to the control, and then rebuild and readd the control to the form?


    Another thing you could try is deleting your obj directory (and the exe/dll files out of the bin folder) I have seen sometimes where VS keeps using a cached copy of compiled code, and it screws things up, or makes changes not show.

    Tuesday, July 3, 2007 1:38 PM
    Moderator
  • Be sure to run the Clean Application function from the Build menu.

     

    Also, click the Show All Files button on the solution explorer and examine the .designer.vb files for the component, and more importantly the form.  You may find errors in here that need to be corrected manually. 

     

    -Edit-

    You may also need to completely remove the control from the form in the designer and then add it back.

    Wednesday, July 4, 2007 3:24 AM
    Moderator