Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Desinger view error with simple inheritance: Constructor on type '' not found.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tribbles - 23 Feb 2006 02:14 GMT
I have a class that inherits user control:
       public partial class ValidationSubDesigner : UserControl {

It works jsut fine, the problem occurs when I try to inherit it:
   public partial class FieldCompareFieldDesigner : ParamDesigner {
   //public partial class FieldCompareFieldDesigner : UserControl {

The top line is required in order to compile, the second line is
required in order to get the designer view to work.   I get the error
below when I try to bring up the designer view.

The full eror and stack trace.

One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project,
while others may require code changes.

Constructor on type
'AbacusControls.PropertyEditors.Designer.ValidationDesigner.SubDesigners.Test'
not found.
Hide

at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.ComponentModel.Design.DesignSurface.CreateInstance(Type type)
at Microsoft.VisualStudio.Design.VSDesignSurface.CreateInstance(Type
type)
at
System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type
componentType, String name)
at
System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type
type, ICollection arguments, String name, Boolean addToContainer)
at
System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type
type, ICollection arguments, String name, Boolean addToContainer)
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager
manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32
fReload)
Stoitcho Goutsev (100) - 23 Feb 2006 14:45 GMT
tribbles,

Do you by any chance declare constructors for your user control that have
parameters. VS designer requires that all controls have parameterless
constructor in order to create them. Keep in mind that the designer creates
instance of the base class, thus when you inherit from UserControl your new
control will be designable even if it doesn't have parameterless
constructor. All controls that inherit from your new control won't be
designable thought.

>I have a class that inherits user control:
>        public partial class ValidationSubDesigner : UserControl {
[quoted text clipped - 48 lines]
> Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32
> fReload)
tribbles - 23 Feb 2006 18:47 GMT
Yes the base class constructor does require 1 argument for its
constructor.  It is an data object that hold all of the parameters that
need to be valdiated depending on the specific valdiation
impelementation.
tribbles - 23 Feb 2006 19:27 GMT
Added an empty constructor to the base and everything is working.
Thank you very much for the wonderful and quick repsonse!  I learned
something new and had an easy fix. :)

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.