object does not contain a constructor that takes 0 argumentshttp://forums.asp.net/t/1799647.aspx/1?object+does+not+contain+a+constructor+that+takes+0+argumentsThu, 03 May 2012 13:36:53 -040017996474963609http://forums.asp.net/p/1799647/4963609.aspx/1?object+does+not+contain+a+constructor+that+takes+0+argumentsobject does not contain a constructor that takes 0 arguments <p>HI I have a class that inherits from another one but i get this confusing error :</p> <p><span class="code-keyword">Error</span> <span class="code-digit">1</span> <span class="code-comment"> '</span><span class="code-comment">WindowDecorator.Decorator' does not contain a constructor that takes 0 arguments</span></p> <p>Error occurs in the constructor.</p> &lt;div style=&quot;display: block;&quot; id=&quot;premain1&quot; class=&quot;pre-action-link&quot; width=&quot;100%&quot;&gt;&nbsp;&lt;/div&gt; <pre id="pre1" lang="cs" style="margin-top:0px"><span class="code-keyword">public</span> <span class="code-keyword">class</span> ScrollDecorator:Decorator { <span class="code-keyword">protected</span> Decorator decorator; <span class="code-keyword">protected</span> <span class="code-keyword">float</span> ScrollPosition; <span class="code-keyword">protected</span> ScrollDecorator(Decorator _decorator) { <span class="code-keyword">this</span>.decorator = _decorator; } <span class="code-keyword">public</span> <span class="code-keyword">void</span> ScrollTo() { </pre> <pre lang="cs" style="margin-top:0px"> } <span class="code-keyword">public</span> <span class="code-keyword">override</span> <span class="code-keyword">void</span> Draw() { } } </pre> &lt;div class=&quot;qa-info clearfix&quot;&gt; &lt;div class=&quot;small-text float-right&quot;&gt;&lt;/div&gt; &lt;/div&gt; 2012-05-03T11:10:08-04:004963630http://forums.asp.net/p/1799647/4963630.aspx/1?Re+object+does+not+contain+a+constructor+that+takes+0+argumentsRe: object does not contain a constructor that takes 0 arguments <p>I think ur Decorator class doesn't contain a constructor that takes 0 arguments.</p> <p>U may need to alter ScrollDecorator's constructor as below</p> <pre class="prettyprint">protected ScrollDecorator(Decorator _decorator) : base('' ,'') //whatever Decorator's constructor expecting { this.decorator = _decorator; }</pre> <p><br> <br> </p> 2012-05-03T11:20:05-04:004963638http://forums.asp.net/p/1799647/4963638.aspx/1?Re+object+does+not+contain+a+constructor+that+takes+0+argumentsRe: object does not contain a constructor that takes 0 arguments <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Ramesh T</h4> ScrollDecorator's constructor as below</blockquote> <p></p> <p>&nbsp;</p> <p>Where sir?</p> 2012-05-03T11:23:41-04:004963712http://forums.asp.net/p/1799647/4963712.aspx/1?Re+object+does+not+contain+a+constructor+that+takes+0+argumentsRe: object does not contain a constructor that takes 0 arguments <p>Hi</p> <p>Do you can to post your code of the class&nbsp;Decorator?</p> 2012-05-03T12:00:54-04:004963870http://forums.asp.net/p/1799647/4963870.aspx/1?Re+object+does+not+contain+a+constructor+that+takes+0+argumentsRe: object does not contain a constructor that takes 0 arguments <p>Ur function must be misssing a argument/parameters.</p> 2012-05-03T13:36:53-04:00