表单设计师下降 [英] Form Designer falling

查看:68
本文介绍了表单设计师下降的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS Community 2015并使用C ++中的Forms。当我在代码中使用Button()而不是System :: Windows :: Forms :: Button()时,表单设计器会掉线。但该项目在同一时间编制并运行良好。

I'm using VS Community 2015 and working with Forms in C++. Form Designer falls when I use Button() instead of System::Windows::Forms::Button() in my code. But the project is compiled and run well at the same time.

我已经完成了所有行动:

There all actions I've done:

1)创建C ++ CLR空项目



2)项目 - >添加新项目 - > UI - > Windows窗体

  (设计师总是显示错误"完成此操作所需的数据尚不可用,如果我将其关闭并再次打开则效果很好。截图:postimg dot org / image / ab6nk9ozx)



3)编辑MyForm.cpp,如下所示:
$

1) create C++ CLR empty project

2) Project -> Add New Item -> UI -> Windows Forms
  (Designer always shows error "The data necessary to complete this operation is not yet avaliable, if I close it and open again it works well. Screenshot: postimg dot org/image/ab6nk9ozx)

3) edit MyForm.cpp like this:

#include "MyForm.h"

using namespace System;
using namespace System::Windows::Forms;

[STAThread]
void Main(array<String^>^ args)  {
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    test123::MyForm form;
    Application::Run(%form);
}


  4)项目 - >属性 - >链接器 - >系统 - > SubSystem = Windows

   &NBSP;项目 - >属性 - >链接器 - >高级 - > EntryPoint = Main



5)使用Designer添加Button¥b $ b $
=====目前全部效果很好=== b


6)在MyForm.h中它存在"使用命名空间System :: Windows :: Forms;"

  替换"this-> button1 =(gcnew System :: Windows :: Forms :: Button());"

     使用"this-> button1 =(gcnew Button());"
$


7)打开设计师



=====现在它不起作用并显示错误"找不到类型'按钮'" =====

 4) Project -> Properties -> Linker -> System -> SubSystem = Windows

     Project -> Properties -> Linker -> Advanced -> EntryPoint = Main

5) add Button using Designer

===== at the moment all works well ===

6) as in MyForm.h it exist "using namespace System::Windows::Forms;"
   replace "this->button1 = (gcnew System::Windows::Forms::Button());"
      with "this->button1 = (gcnew Button());"

7) open Designer

===== now it doesn't work and showing error "Could not find type 'Button'" =====

屏幕截图:postimg dot org / image / uqv7j61e7

Screenshot: postimg dot org/image/uqv7j61e7

同时项目已经完成并且运行良好,但是Designer没有工作



如果我退回"System :: Windows :: Forms ::"错误消失,设计师工作正常

At the same time project is compieled and run well, but Designer doesn't work

If I return back "System::Windows::Forms::" the error disappears and Designer work well

推荐答案

朋友,

如果Visual Studio本身是32位,并且无法对64位的某些组件(例如ListView)进行GUI编辑。

If Visual Studio is natively 32bit and one cannot do GUI editing for some components (E.g. ListView) in 64bit.

当您遇到此问题时,可以按照以下步骤进行修复:

You may fix it by the follow steps, when you're facing this issue:


  1. <跨度>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
    将解决方案更改为32位
  2.            
    清理并重建解决方案
  3.            
    打开GUI进行编辑
  4.            
    保存,将解决方案更改回64位
  5.            
    清理和重建
  6.            
    以64位运行
  1.             Change the solution to 32bit
  2.             Clean and rebuild the solution
  3.             Open the GUI for editing
  4.             Save, change the solution back to 64bit
  5.             Clean and rebuild
  6.             Run in 64bit

祝你好运,

Fletch


这篇关于表单设计师下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆