Usercontrol act as container (custom control)
-
Thursday, May 08, 2008 10:12 AM
Hi,
I am experiencing problems with making a custom panel for the compact framework. The problem is that the control doesn’t acts as a container even tough I add a custom designer in the designtimeattributes.
Here's the (shortened) code for my control:
Code Snippetusing System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
#if !WindowsCE
using System.ComponentModel;
#endif
using System.Windows.Forms;
namespace Punch.Controls {
/// <summary>
/// Supports animations
/// </summary>
#if !WindowsCE
[Designer("System.Windows.Forms.Design.ParentControlDesigner,System.Design",
typeof(System.ComponentModel.Design.IDesigner))]
#endif
public class pPanel : UserControl{// the code
}
This are my designtimeattributes in the xmta file:
Code Snippet<Class Name="Punch.Controls.pPanel">
<Designer>
<Type>Microsoft.CompactFramework.Design.WindowsCE.PanelDesigner, Microsoft.CompactFramework.Design.WindowsCE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null</Type>
<BaseType />
</Designer>
<DefaultProperty>BackColor</DefaultProperty>
<Docking />
<DesktopCompatible>true</DesktopCompatible>
<Property Name="BorderStyle">
<DesignerSerializationVisibility>DesignerSerializationVisibility.Visible</DesignerSerializationVisibility>
</Property>
</Class>
The strange thing is that visual studio does loads the designer dll when i look at it with process explorer, but the component just doesn't acts as a panel.
Anyone has some thoughts on this?
Answers
-
Friday, May 09, 2008 11:08 AM
Ok, I got it fixed.
Appaerently VS2005 added the <BaseType /> tag when i edited the xmta with the classdiagram ... so after removing it it used the designer ...
I hope someone else with this problem finds this thread instead of also wasting a day on this issue.