Custom Control Inheritance

H

houghtelling

I have a Windows Mobile 5.0 Pocket PC project named
CuiNetCF.Windows.Forms. I have created a TextBox class that is
inherited from System.Windows.Forms.TextBox, which works perfectly. I
have added additional properties to this textbox. From here, I have
created another inherited textbox call BranchTextBox that is inherited
from CuiNetCF.Windows.Forms.TextBox.

namespace CuiNetCF.Windows.Forms
{
public partial class TextBox : System.Windows.Forms.TextBox
{
...
}
}

namespace CuiNetCF.Windows.Forms
{
public partial class BranchTextBox : CuiNetCF.Windows.Forms.TextBox
{
...
}
}

When viewing the BranchTextBox in the designer I receive the following
message (unless I add a circular reference to the assembly):

"The designer could not be shown for this file because none of the
classes within it can be designed. The designer inspected the following
classes in the file: BranchTextBox --- The base class
'CuiNetCF.Windows.Forms.TextBox' could not be loaded. Ensure the
assembly has been referenced and that all projects have been built."

This message goes away if I include a reference the project, but it
doesn't seem right that I would need to add a reference to the same
project! What am I missing???
 
H

houghtelling

Have you set the control's DesktopCompatible attribute to true?

If I include the DesktopCompatible(true) attribute I get this error
message at compile time:

Error 1: The type or namespace name 'DesktopCompatible' could not be
found (are you missing a using directive or an assembly
reference?) P:\VC#2\CompactFramework\CuiNetCF.Windows.Forms\TextBox.cs 20 6 CuiNetCF.Windows.Forms

I created another test project with absolution no added code and I'm
still receving the same error message when trying to view the
BranchTextBox.cs in Design view.

Thanks,
Jerod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top