Using Custom Controls in Designer from .cs source files
-
Hi, I have the following problem when trying to use Custom Controls published here at CodeProject with the full source code: 1.) I add the control source to my project 2.) Project compiles, everythings fine. When I now want to add the control using the designer, I have to import it from the binary assembly the project has created ( so I'm referencing myself). Is there another way of registering in the toolbox just using the sourcecode ? Its a bit annoying, because I get a warning that I'm using a different type. The most ExampleProjects have all integrated, but don't reference the outputbinary for having designer support. I don't want to create a separate assembly containing all controls at the moment and I didn't found another solution yet. Many thanks, Florian
-
Hi, I have the following problem when trying to use Custom Controls published here at CodeProject with the full source code: 1.) I add the control source to my project 2.) Project compiles, everythings fine. When I now want to add the control using the designer, I have to import it from the binary assembly the project has created ( so I'm referencing myself). Is there another way of registering in the toolbox just using the sourcecode ? Its a bit annoying, because I get a warning that I'm using a different type. The most ExampleProjects have all integrated, but don't reference the outputbinary for having designer support. I don't want to create a separate assembly containing all controls at the moment and I didn't found another solution yet. Many thanks, Florian
I think VS 2005 hadnles this issue better than VS 03. For VS2003 and if the control is inheriting from UserControl than double clicking it (so that the designer view pops up) then it should automatically being added to the toolbox.
-
I think VS 2005 hadnles this issue better than VS 03. For VS2003 and if the control is inheriting from UserControl than double clicking it (so that the designer view pops up) then it should automatically being added to the toolbox.
Hi Robert, if I click on the control sourcecode item ( e.g. Control.cs) i get a screen with the follwing text (window tab says "Control.cs [Design]": To add components to your class, drag them from the Toolbox and use the Properties window to set their properties. To create events for your class, click here to switch to code view. Well, that pretty obvious, but I have no idea how to convince the toolbox when editing a form to display the control which is only existing in sourcecode at that moment. Ok, it seems that the Control I use is not inherited from UserControl, so it may not work here. But you mean, if doubleclicking the sourcefile in the project should be enough if it is inherited from UserControl ? Thanks, Florian
-
Hi Robert, if I click on the control sourcecode item ( e.g. Control.cs) i get a screen with the follwing text (window tab says "Control.cs [Design]": To add components to your class, drag them from the Toolbox and use the Properties window to set their properties. To create events for your class, click here to switch to code view. Well, that pretty obvious, but I have no idea how to convince the toolbox when editing a form to display the control which is only existing in sourcecode at that moment. Ok, it seems that the Control I use is not inherited from UserControl, so it may not work here. But you mean, if doubleclicking the sourcefile in the project should be enough if it is inherited from UserControl ? Thanks, Florian
Keep the control code seperate from your own. Make the control it's own seperate Project, then you can have it show up in the ToolBox. Dave Kreskowiak Microsoft MVP - Visual Basic