Custom control problem under VS 2005 Beta 2 CF 2.0

J

Jen

Hi,



I have several custom controls that all work correctly when placed on a form
and appear on the toolbox. The problem that I'm seeing is that 2 of the 5
controls disable form inheritance when placed on the base form. If I remove
both of these controls from the base form then my form inheritance works
again and I can see the other controls on the form.



I get the error "Visual inheritance is currently disabled because the base
class references a device-specific component or contains p/invoke" on the
non-base forms at design time.



I have checked and neither of the controls uses p/invoke.



What would a device specific component be? The SIP control? I remarked it
out.



What other things could cause this?



Anyone care to see the code?



These are some of the references.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using Microsoft.WindowsCE.Forms;
using System.Diagnostics;



I also have a reference to "System.Windows.Forms.DataGrid" in the solution
explorer

However i cant add "using System.Windows.Forms.DataGrid" cause i get the
error that it is a type not a namespace.



These 2 controls are the only ones that have a reference to the datagrid
(possible clue)



So if I have a custom control that refers to the datagrid does this kill
form inheritance?



Thanks
 
J

Jen

UPDATE

I removed my references to the grid control and remarked out all lines using
the grid. Now the custom control works with form inheritance.

However this creates a big problem for me. I need to see the datagrid on
forms that inherit from the base form so i can set table and column styles
at design time :(

Any ideas what can be done to allow a datagrid on a base form to work with
form inheritance?

Thanks
 
J

Jen

CLARIFICATION

These are custom controls that reference the datagrid control. If the
references to the datagrid are pulled out of the custom control then form
inheritance works again.
 

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