简体   繁体   English

VB6 -> VB.NET … 在 Z303CB0EF9EDB9082D61BBBE5825D9 中找不到 Canvas 控件

[英]VB6 -> VB.NET … Cannot find the Canvas control in .NET

I am trying to convert some old VB6 code to VB.NET.我正在尝试将一些旧的 VB6 代码转换为 VB.NET。 The VB6 uses a Canvas control, simply VB6 使用 Canvas 控制,简单

Dim cv as Canvas

I cannot for the life of me figure out how to use the Canvas control in VB.NET (using VS2005).我终生无法弄清楚如何在 VB.NET 中使用 Canvas 控件(使用 VS2005)。 MSDN says it is in the System.Windows.Controls namespace, which doesn't seem to exist? MSDN 说它在 System.Windows.Controls 命名空间中,这似乎不存在? All I see is System.Windows.Forms, which doesn't include the Canvas control.我看到的只是 System.Windows.Forms,其中不包括 Canvas 控件。 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.您需要找出 Canvas 在 VB6 中的内容,然后您将能够在 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我之前在 VB6 之前没有遇到过 Canvas

In recent history things have changed a bit here.在最近的历史中,这里发生了一些变化。 There are now two sets of windows frameworks.现在有两套 windows 框架。

Forms are the old one. Forms 是旧的。 The new ones are controls, and they come in the WPF and Silverlight variety.新的是控件,它们有 WPF 和 Silverlight 品种。 WPF is to replace windows forms, silverlight is meant for the web, etc etc. 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.由于您使用的是较旧的 VS2005,我相信您需要安装 WPF 扩展才能访问它们。

Unfortunately the WPF Extensions for VS2005 are no longer supported by Microsoft:不幸的是,Microsoft 不再支持 VS2005 的 WPF 扩展:

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 http://blogs.msdn.com/b/acangialosi/archive/2008/06/27/vs-2005-extensions-for-net-framework-3-0-wpf-wcf-ctp-is-coming-off-该-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.您仍然可以从不同的地方获得它们,但为了您自己的方便,如果您想使用 WPF/Silverlight,您可能应该考虑至少升级到 VS2008。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM