开发者

VB6 -> VB.NET ... Cannot find the Canvas control in .NET

I am trying to convert some old VB6 code to VB.NET. The V开发者_如何学运维B6 uses a Canvas control, simply

Dim cv as Canvas

I cannot for the life of me figure out how to use the Canvas control in VB.NET (using VS2005). MSDN says it is in the System.Windows.Controls namespace, which doesn't seem to exist? All I see is System.Windows.Forms, which doesn't include the Canvas control. Any tips?

Thanks


You need to find out what the Canvas was in VB6, then you will be able to see what the nearest equivalent is in VB.Net.

I think it must have been an obscure third-party control or possibly some custom code. I've not come across Canvas before in VB6


In recent history things have changed a bit here. There are now two sets of windows frameworks.

Forms are the old one. The new ones are controls, and they come in the WPF and Silverlight variety. WPF is to replace windows forms, silverlight is meant for the web, etc etc.

Since you are using the older VS2005, I believe you will need to install the WPF extensions to get access to them.

Unfortunately the WPF Extensions for VS2005 are no longer supported by Microsoft:

http://blogs.msdn.com/b/acangialosi/archive/2008/06/27/vs-2005-extensions-for-net-framework-3-0-wpf-wcf-ctp-is-coming-off-the-ms-download-center.aspx

You can still get them from various places, but for your own ease you should probably consider upgrading to at least VS2008 if you want to use WPF/Silverlight.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜