Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Visual Studio SDK: Error Cannot implicitly convert type ‘…MyUserControl' to 'System.Windows.Forms.IWin32Window'

$
0
0

I am creating a Visual Studio options page exactly as described in the example - Walkthrough: Creating an Options Page located athttp://msdn.microsoft.com/en-us/library/bb166195.aspx- I am receiving the following error - Cannot implicitly convert type '...MyUserControl' to 'System.Windows.Forms.IWin32Window'' as I return the usercontrol page to IWin32Window for the following code:

[Browsable(false)]
[DesignerSerializationVisibility(
	DesignerSerializationVisibility.Hidden)]
protected override IWin32Window Window
{
	get
        {
        	MyUserControl page = new MyUserControl();
                page.optionsPage = this;
                page.Initialize();               
                return page;
        }            
}

I tried explicit conversion and received and an invalid cast exception. The platform is Windows 8.1 and Visual Studios 2013 update 2.





Viewing all articles
Browse latest Browse all 4410

Trending Articles



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