On 29 Nov, 23:35, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
On 2007-11-29 13:48:08 -0800, Dave Kelly <Dave.a.Ke...@googlemail.comsaid:
c#, .Net 2.0, VS2008
I have a user control, and wish to embed other custom/user controls
within this control.
I am getting problems in compilation though, that the type or
namespace cannot be found.
[...]
Any way of resolving this?
Undoubtedly.
You haven't really offered much in the way of specifics, but generally
speaking you'll get a compilation error like that if you've failed to
be specific enough about the namespace for some type you're using, or
you've failed to add a necessary reference to the project (under
"References" in the Solution Explorer).
If the former, you can solve that either by providing the fully
qualified name for the namespace before the type, or you can provide an
appropriate "using" statement at the beginning of the source file.
Not knowing the exact error, it's impossible to know what namespace or
reference hasn't been included. But it may be as simple as needing to
add a reference to the assembly for your custom control.
Pete
The situation is I have the source for both of the components in the
same project. Simplifying it, I have a control derived from the
TabPage, and another control derived from the CheckBox, which I wish
to programmatically place on the TabPage.
Both controls are in the same project, and using the same namespace.
I can use either control in any part of the project (eg put the
derived checkbox on the mainform), just not use it in the custom
tabpage control.
Note: I am not trying to solve the specifics of how to add the
checkbox derived control, but generically, as there are a few other
controls I wish to use on my derived TabPage.
Even when I tried to use a DLL of the custom controls, and referenced
the assembly in the project, I still got the same error.