得到一个错误 [英] Getting An error
本文介绍了得到一个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
#pragma once
#include "Form4.h"
#include "Form6.h"
#include "Form7.h"
#include "Form9.h"
#include "Form8.h"
namespace DataStructuresProject {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form3
/// </summary>
public ref class Form3 : public System::Windows::Forms::Form
{
public:
Form3(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form3()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ Addcoursebutton;
protected:
private: System::Windows::Forms::Button^ updatecoursebutton;
private: System::Windows::Forms::Button^ viewcoursedetialsbutton;
private: System::Windows::Forms::Button^ viewsortingbutton;
private: System::Windows::Forms::Button^ deletecoursebutton;
private: System::Windows::Forms::Label^ Managecourselabel;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form3::typeid));
this->Addcoursebutton = (gcnew System::Windows::Forms::Button());
this->updatecoursebutton = (gcnew System::Windows::Forms::Button());
this->viewcoursedetialsbutton = (gcnew System::Windows::Forms::Button());
this->viewsortingbutton = (gcnew System::Windows::Forms::Button());
this->deletecoursebutton = (gcnew System::Windows::Forms::Button());
this->Managecourselabel = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// Addcoursebutton
//
this->Addcoursebutton->Location = System::Drawing::Point(408, 205);
this->Addcoursebutton->Name = L"Addcoursebutton";
this->Addcoursebutton->Size = System::Drawing::Size(87, 39);
this->Addcoursebutton->TabIndex = 0;
this->Addcoursebutton->Text = L"Add Course";
this->Addcoursebutton->UseVisualStyleBackColor = true;
this->Addcoursebutton->Click += gcnew System::EventHandler(this, &Form3::Addcoursebutton_Click);
//
// updatecoursebutton
//
this->updatecoursebutton->Location = System::Drawing::Point(408, 267);
this->updatecoursebutton->Name = L"updatecoursebutton";
this->updatecoursebutton->Size = System::Drawing::Size(87, 37);
this->updatecoursebutton->TabIndex = 1;
this->updatecoursebutton->Text = L"Update Course";
this->updatecoursebutton->UseVisualStyleBackColor = true;
this->updatecoursebutton->Click += gcnew System::EventHandler(this, &Form3::updatecoursebutton_Click);
//
// viewcoursedetialsbutton
//
this->viewcoursedetialsbutton->Location = System::Drawing::Point(408, 322);
this->viewcoursedetialsbutton->Name = L"viewcoursedetialsbutton";
this->viewcoursedetialsbutton->Size = System::Drawing::Size(87, 39);
this->viewcoursedetialsbutton->TabIndex = 2;
this->viewcoursedetialsbutton->Text = L"View Course Details";
this->viewcoursedetialsbutton->UseVisualStyleBackColor = true;
this->viewcoursedetialsbutton->Click += gcnew System::EventHandler(this, &Form3::viewcoursedetialsbutton_Click);
//
// viewsortingbutton
//
this->viewsortingbutton->Location = System::Drawing::Point(408, 377);
this->viewsortingbutton->Name = L"viewsortingbutton";
this->viewsortingbutton->Size = System::Drawing::Size(87, 46);
this->viewsortingbutton->TabIndex = 3;
this->viewsortingbutton->Text = L"View Sorting";
this->viewsortingbutton->UseVisualStyleBackColor = true;
this->viewsortingbutton->Click += gcnew System::EventHandler(this, &Form3::viewsortingbutton_Click);
//
// deletecoursebutton
//
this->deletecoursebutton->Location = System::Drawing::Point(408, 443);
this->deletecoursebutton->Name = L"deletecoursebutton";
this->deletecoursebutton->Size = System::Drawing::Size(87, 38);
this->deletecoursebutton->TabIndex = 4;
this->deletecoursebutton->Text = L"Delete Course";
this->deletecoursebutton->UseVisualStyleBackColor = true;
this->deletecoursebutton->Click += gcnew System::EventHandler(this, &Form3::deletecoursebutton_Click);
//
// Managecourselabel
//
this->Managecourselabel->AutoSize = true;
this->Managecourselabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 25, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->Managecourselabel->Location = System::Drawing::Point(318, 125);
this->Managecourselabel->Name = L"Managecourselabel";
this->Managecourselabel->Size = System::Drawing::Size(276, 39);
this->Managecourselabel->TabIndex = 5;
this->Managecourselabel->Text = L"Manage Courses";
//
// Form3
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(932, 550);
this->Controls->Add(this->Managecourselabel);
this->Controls->Add(this->deletecoursebutton);
this->Controls->Add(this->viewsortingbutton);
this->Controls->Add(this->viewcoursedetialsbutton);
this->Controls->Add(this->updatecoursebutton);
this->Controls->Add(this->Addcoursebutton);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->MaximizeBox = false;
this->Name = L"Form3";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"Home and Away Institutue Timetable System";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void Form3_Load(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void Addcoursebutton_Click(System::Object^ sender, System::EventArgs^ e) {
Form4^ myform= gcnew Form4;
myform->Show();
this->Hide();
}
private: System::Void updatecoursebutton_Click(System::Object^ sender, System::EventArgs^ e) {
Form6^ myform= gcnew Form6;
myform->Show();
this->Hide();
}
private: System::Void viewcoursedetialsbutton_Click(System::Object^ sender, System::EventArgs^ e) {
Form7^ myform= gcnew Form7;
myform->Show();
this->Hide();
}
private: System::Void viewsortingbutton_Click(System::Object^ sender, System::EventArgs^ e) {
Form8^ myform = gcnew Form8;
myform->Show();
this->Hide();
}
private: System::Void deletecoursebutton_Click(System::Object^ sender, System::EventArgs^ e) {
Form9^ myform= gcnew Form9;
myform->Show();
this->Hide();
}
};
}
推荐答案
在Form8.h文件中是否正确声明了Form8?
Is Form8 properly declared in Form8.h file ?
您还可以使用"转到定义"来验证您的代码是否可用于您的代码。视觉工作室的功能。
You can also verify whether a class named Form8 is available to you code by using "go to definition" feature of visual studio.
我认为您在代码中声明Form8和其他表单的方式有问题。
I think there is something wrong with how you declared Form8 and other forms being referenced in your code.
这篇关于得到一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文