I'm working on a windows forms projects in microsoft visual studio and when I autogenerated the windows form code there were errors everywhere.
I've put everything with an error in stars (it wouldn't let me do italics etc.)
namespace FormsTest {
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 MainDisplay
/// </summary>
*public* ref class MainDisplay : public System::Windows::Forms::Form
{
public:
MainDisplay(void)
{
InitializeComponent();
initialiseDatabase();
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~MainDisplay()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::PictureBox^ pictureBox1;
protected:
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)
{
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit();
this->SuspendLayout();
//
// pictureBox1
//
*this*->pictureBox1->Location = System::Drawing::Point(12, 74);
*this*->pictureBox1->Name = L"pictureBox1";
*this*->pictureBox1->Size = System::Drawing::Size(960, 355);
*this*->pictureBox1->TabIndex = 0;
*this*->pictureBox1->TabStop = false;
//
// MainDisplay
//
*this*->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
*this*->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
*this*->ClientSize = System::Drawing::Size(984, 461);
*this*->Controls->Add(this->pictureBox1);
*this*->Name = L"MainDisplay";
*this*->Text = L"MainDisplay";
*this*->Load += gcnew System::EventHandler(this, &MainDisplay::MainDisplay_Load);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit();
this->ResumeLayout(false);
}
It is saying that the "System" must be a namespace name
This is the first time that I've used windows forms I've mostly just used the console.
Thanks for any help you can offer.
public
fromSystem::Windows::Forms::Form
and I think it is onlySystem::Windows::Forms
– DJ Burb