Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 03, 2012 01:36 PM by ziaulrahman
Member
123 Points
125 Posts
May 03, 2012 11:10 AM|LINK
HI I have a class that inherits from another one but i get this confusing error :
Error 1 'WindowDecorator.Decorator' does not contain a constructor that takes 0 arguments
Error occurs in the constructor.
public class ScrollDecorator:Decorator { protected Decorator decorator; protected float ScrollPosition; protected ScrollDecorator(Decorator _decorator) { this.decorator = _decorator; } public void ScrollTo() {
} public override void Draw() { } }
Contributor
5131 Points
827 Posts
May 03, 2012 11:20 AM|LINK
I think ur Decorator class doesn't contain a constructor that takes 0 arguments.
U may need to alter ScrollDecorator's constructor as below
protected ScrollDecorator(Decorator _decorator) : base('' ,'') //whatever Decorator's constructor expecting { this.decorator = _decorator; }
May 03, 2012 11:23 AM|LINK
Ramesh T ScrollDecorator's constructor as below
Where sir?
Participant
947 Points
201 Posts
May 03, 2012 12:00 PM|LINK
Hi
Do you can to post your code of the class Decorator?
483 Points
179 Posts
May 03, 2012 01:36 PM|LINK
Ur function must be misssing a argument/parameters.
Anele
Member
123 Points
125 Posts
object does not contain a constructor that takes 0 arguments
May 03, 2012 11:10 AM|LINK
HI I have a class that inherits from another one but i get this confusing error :
Error 1 'WindowDecorator.Decorator' does not contain a constructor that takes 0 arguments
Error occurs in the constructor.
<div style="display: block;" id="premain1" class="pre-action-link" width="100%"> </div>} public override void Draw() { } }<div class="qa-info clearfix"> <div class="small-text float-right"></div> </div>Ramesh T
Contributor
5131 Points
827 Posts
Re: object does not contain a constructor that takes 0 arguments
May 03, 2012 11:20 AM|LINK
I think ur Decorator class doesn't contain a constructor that takes 0 arguments.
U may need to alter ScrollDecorator's constructor as below
protected ScrollDecorator(Decorator _decorator) : base('' ,'') //whatever Decorator's constructor expecting { this.decorator = _decorator; }Anele
Member
123 Points
125 Posts
Re: object does not contain a constructor that takes 0 arguments
May 03, 2012 11:23 AM|LINK
Where sir?
pierrefrc
Participant
947 Points
201 Posts
Re: object does not contain a constructor that takes 0 arguments
May 03, 2012 12:00 PM|LINK
Hi
Do you can to post your code of the class Decorator?
ziaulrahman
Member
483 Points
179 Posts
Re: object does not contain a constructor that takes 0 arguments
May 03, 2012 01:36 PM|LINK
Ur function must be misssing a argument/parameters.
Mark answer if it helps.