Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

[VB2010] This method has been deprecated...

$
0
0
Two questions:

1) In the code of a custom control this code:

Code:

        [System.Obsolete]
        public override void OnSetComponentDefaults()
                {
                        base.OnSetComponentDefaults();
                       
        }

Makes this notice:

Quote:

'System.ComponentModel.Design.ComponentDesigner.OnSetComponentDefaults()' is obsolete: '"This method has been deprecated. Use InitializeNewComponent instead. http://go.microsoft.com/fwlink/?linkid=14202"'
Well I read: "Use InitializeNewComponent instead.".... yes, but.........HOW? If I replace OnSetComponentDefaults with InitializeNewComponent I get the notice ":

Quote:

It is expected a get or set access function
and if I write:

Code:

        [System.Obsolete]
        public override void InitializeNewComponent
                {
          get
            {
                base.InitializeNewComponent;
            }
                       
    }

I get the notice:

Quote:

Only assignments, calls, increases, decreases, and new object expressions can be used as instructions
2) Second question:

Instead of complie the control and add the .dll to the project as external file... is possible to add the several files DIRECTLY into a VB project?

Ty :)

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>