我在C ++ / CLI中制作Windows应用程序。自定义应用程序菜单时出错。我有一个名为DELETE FROM invoice
WHERE inv_date < DATE '2018-03-31' - INTERVAL '72' MONTH
的课程如下:
CustomMenuColorTable
我在我的表单类中使用它,如下所示:
namespace SassEngine {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class CustomMenuColorTable : public System::Windows::Forms::ProfessionalColorTable {
public:
CustomMenuColorTable();
Color text_color = Color::FromArgb(241, 241, 241);
Color main_window_bg_color = Color::FromArgb(45, 45, 48);
Color button_hover_bg_color = Color::FromArgb(63, 63, 70);
Color button_active_bg_color = Color::FromArgb(0, 122, 204);
Color border_color = Color::FromArgb(78, 78, 80);
public:
property Color MenuBorder {
public: virtual Color get() override {
return border_color;
};
};
};
}
执行此操作并打开表单设计器后,我不断收到此错误,
找不到类型&#39; CustomMenuColorTable&#39;。请确认 包含此类型的程序集。如果是这种类型 是您的开发项目的一部分,确保项目具有 已成功使用当前平台的设置或 任何CPU.0
但是当我运行该应用程序时,它工作正常。但是,当我只是在表单设计器private: System::Windows::Forms::MenuStrip^ ApplicationMenu;
void InitializeComponent(void) {
this->ApplicationMenu = (gcnew System::Windows::Forms::MenuStrip());
// #begin
this->ApplicationMenu->Renderer = (gcnew
System::Windows::Forms::ToolStripProfessionalRenderer(gcnew CustomMenuColorTable()));
this->ApplicationMenu->ForeColor =
System::Drawing::Color::FromArgb(static_cast<System::Int32>(
static_cast<System::Byte>(241)),
static_cast<System::Int32>(static_cast<System::Byte>(241)),
static_cast<System::Int32>(static_cast<System::Byte>(241))
);
// #end
}
到// #begin
(在表单类中注释)中删除时。
请帮我解决这个问题我对Windows API不熟悉。