2017年可视化表单设计器没有按规定“找不到类错误” - 然而,类存在

问题描述 投票:1回答:1

我加入了一些更多的控制权,以一个双赢的形式我创建从一个.dll运行

该项目加载罚款后,我做了一些修改形式可视化设计的形式,编译,然后尝试打开窗体...我这个错误屏幕门前。

The error screen presented on the form designer

这是抱怨,因为它无法找到NoButtonsTabControl类。

该NoTabControl.cs类:

namespace TFG_Tools {

// Extend TabControl Class to provide a multi layer canvas with hidden tabs or buttons
public class NoButtonsTabControl : TabControl {
    public NoButtonsTabControl() {
        Appearance = TabAppearance.FlatButtons;
        ItemSize = new Size(0, 1);
        //SizeMode = TabSizeMode.Fixed;
    }

    protected override void WndProc(ref Message m) {
        // Hide tabs by trapping the TCM_ADJUSTRECT message
        if (m.Msg == 0x1328) m.Result = (IntPtr)1;
        else base.WndProc(ref m);
    }

    }// end NoButtonsTabControl class

}

主窗体类的开始看起来像这样...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using ENSED;
using System.Globalization;
using Win32;
using WindowsEnv;

namespace TFG_Tools {


public partial class TradePanelForm : Form {
    //loaded as master
    private bool isMaster = false;
    public void SetAsMaster() { isMaster = true; }

    ...

为什么会发生这种突然刚才发生了,这么折腾。我只能用C#和Visual Studio中间。我只用它为这个项目创造的winform。

我该如何告诉设计师那里这个类,那么这个错误停止出现?

有趣的是,之前工作得很好,这种安排!如果我编译代码,它的工作原理,以及所有的表单元素的存在。

这只是其中ATM垂死的设计师。

P.S我也从Visual Studio 2015年搬到这个项目在

谢谢。

visual-studio winforms
1个回答
1
投票

我对这个解决方案很奇怪。

  1. 关闭所有打开的窗口在您的项目
  2. 选择“任何CPU”的个人资料
  3. 去建设 - >干净的解决方案
  4. 然后建设 - >重建溶液
  5. 重新打开你的窗体设计器

这为我工作,并希望将每次弹出时间清理这个烂摊子了。

我有2个配置文件,一个32位和64位的个人资料,所以我可以编译DLL两者。

当我切换到这些配置文件来构建项目必须的东西在设计突破。

希望这可以节省时间给别人。

© www.soinside.com 2019 - 2024. All rights reserved.