Hello,
I am trying to get a grip on where to place the initialization of two
arrays in the code below which was created using Visual C++ 2005
Express Beta 2...
private: static array<String^>^ LHSquestions = gcnew array<String^>
{"question 1","question 2"};
private: static array<String^>^ RHSquestions = gcnew array<String^>
{"question 1",
"question 2"};
I had assumed that I would add them after the other private lines
below? Any suggestions for a beginner's Internet tutorial or book on
using C++ Express language?
Cheers
Geoff
!
#pragma once
namespace trackbar1
{
using namespace System;
using namespace System::Compone ntModel;
using namespace System::Collect ions;
using namespace System::Windows ::Forms;
using namespace System::Data;
using namespace System::Drawing ;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will
need to change the
/// 'Resource File Name' property for the managed
resource compiler tool
/// associated with all .resx files this class
depends on. Otherwise,
/// the designers will not be able to interact
properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows ::Forms::Form
{
public:
Form1(void)
{
InitializeCompo nent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing ">"descript ion of the
parameter"</param>
virtual void Dispose(Boolean disposing) override
{
if (disposing && components)
{
delete components;
}
__super::Dispos e(disposing);
}
private: System::Windows ::Forms::TrackB ar^ trackBar1;
protected:
private: System::Windows ::Forms::Pictur eBox^ pictureBox1;
private: System::Windows ::Forms::Label^ label1;
private: System::Windows ::Forms::Label^ label2;
private: System::Windows ::Forms::Button ^ button1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::Compone ntModel::Contai ner ^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 InitializeCompo nent(void)
{
System::Compone ntModel::Compon entResourceMana ger^ resources = (gcnew
System::Compone ntModel::Compon entResourceMana ger(Form1::type id));
this->trackBar1 = (gcnew
System::Windows ::Forms::TrackB ar());
this->pictureBox1 = (gcnew
System::Windows ::Forms::Pictur eBox());
this->label1 = (gcnew
System::Windows ::Forms::Label( ));
this->label2 = (gcnew
System::Windows ::Forms::Label( ));
this->button1 = (gcnew
System::Windows ::Forms::Button ());
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->trackBar1))->BeginInit();[/color]
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->pictureBox1) )->BeginInit();[/color]
this->SuspendLayout( );
//
// trackBar1
//
this->trackBar1->Location =
System::Drawing ::Point(90, 168);
this->trackBar1->Name = L"trackBar1" ;
this->trackBar1->Size =
System::Drawing ::Size(104, 45);
this->trackBar1->TabIndex = 0;
//
// pictureBox1
//
this->pictureBox1->Image =
(cli::safe_cast <System::Drawin g::Image^[color=blue]
>(resources->GetObject(L"pi ctureBox1.Image ")));[/color]
this->pictureBox1->Location =
System::Drawing ::Point(37, 13);
this->pictureBox1->Name = L"pictureBox 1";
this->pictureBox1->Size =
System::Drawing ::Size(212, 134);
this->pictureBox1->TabIndex = 1;
this->pictureBox1->TabStop = false;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location =
System::Drawing ::Point(27, 182);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing ::Size(31,
13);
this->label1->TabIndex = 2;
this->label1->Text = L"label1";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location =
System::Drawing ::Point(230, 182);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing ::Size(31,
13);
this->label2->TabIndex = 3;
this->label2->Text = L"label2";
//
// button1
//
this->button1->Location =
System::Drawing ::Point(100, 219);
this->button1->Name = L"button1";
this->button1->Size =
System::Drawing ::Size(75, 23);
this->button1->TabIndex = 4;
this->button1->Text = L"NEXT";
//
// Form1
//
this->AutoScaleDimen sions =
System::Drawing ::SizeF(6, 13);
this->AutoScaleMod e =
System::Windows ::Forms::AutoSc aleMode::Font;
this->ClientSize = System::Drawing ::Size(292,
266);
this->Controls->Add(this->button1);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->pictureBox1) ;
this->Controls->Add(this->trackBar1);
this->Name = L"Form1";
this->Text = L"Form1";
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->trackBar1))->EndInit();[/color]
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->pictureBox1) )->EndInit();[/color]
this->ResumeLayout(f alse);
this->PerformLayout( );
}
#pragma endregion
};
}
I am trying to get a grip on where to place the initialization of two
arrays in the code below which was created using Visual C++ 2005
Express Beta 2...
private: static array<String^>^ LHSquestions = gcnew array<String^>
{"question 1","question 2"};
private: static array<String^>^ RHSquestions = gcnew array<String^>
{"question 1",
"question 2"};
I had assumed that I would add them after the other private lines
below? Any suggestions for a beginner's Internet tutorial or book on
using C++ Express language?
Cheers
Geoff
!
#pragma once
namespace trackbar1
{
using namespace System;
using namespace System::Compone ntModel;
using namespace System::Collect ions;
using namespace System::Windows ::Forms;
using namespace System::Data;
using namespace System::Drawing ;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will
need to change the
/// 'Resource File Name' property for the managed
resource compiler tool
/// associated with all .resx files this class
depends on. Otherwise,
/// the designers will not be able to interact
properly with localized
/// resources associated with this form.
/// </summary>
public ref class Form1 : public System::Windows ::Forms::Form
{
public:
Form1(void)
{
InitializeCompo nent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing ">"descript ion of the
parameter"</param>
virtual void Dispose(Boolean disposing) override
{
if (disposing && components)
{
delete components;
}
__super::Dispos e(disposing);
}
private: System::Windows ::Forms::TrackB ar^ trackBar1;
protected:
private: System::Windows ::Forms::Pictur eBox^ pictureBox1;
private: System::Windows ::Forms::Label^ label1;
private: System::Windows ::Forms::Label^ label2;
private: System::Windows ::Forms::Button ^ button1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::Compone ntModel::Contai ner ^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 InitializeCompo nent(void)
{
System::Compone ntModel::Compon entResourceMana ger^ resources = (gcnew
System::Compone ntModel::Compon entResourceMana ger(Form1::type id));
this->trackBar1 = (gcnew
System::Windows ::Forms::TrackB ar());
this->pictureBox1 = (gcnew
System::Windows ::Forms::Pictur eBox());
this->label1 = (gcnew
System::Windows ::Forms::Label( ));
this->label2 = (gcnew
System::Windows ::Forms::Label( ));
this->button1 = (gcnew
System::Windows ::Forms::Button ());
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->trackBar1))->BeginInit();[/color]
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->pictureBox1) )->BeginInit();[/color]
this->SuspendLayout( );
//
// trackBar1
//
this->trackBar1->Location =
System::Drawing ::Point(90, 168);
this->trackBar1->Name = L"trackBar1" ;
this->trackBar1->Size =
System::Drawing ::Size(104, 45);
this->trackBar1->TabIndex = 0;
//
// pictureBox1
//
this->pictureBox1->Image =
(cli::safe_cast <System::Drawin g::Image^[color=blue]
>(resources->GetObject(L"pi ctureBox1.Image ")));[/color]
this->pictureBox1->Location =
System::Drawing ::Point(37, 13);
this->pictureBox1->Name = L"pictureBox 1";
this->pictureBox1->Size =
System::Drawing ::Size(212, 134);
this->pictureBox1->TabIndex = 1;
this->pictureBox1->TabStop = false;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location =
System::Drawing ::Point(27, 182);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing ::Size(31,
13);
this->label1->TabIndex = 2;
this->label1->Text = L"label1";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location =
System::Drawing ::Point(230, 182);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing ::Size(31,
13);
this->label2->TabIndex = 3;
this->label2->Text = L"label2";
//
// button1
//
this->button1->Location =
System::Drawing ::Point(100, 219);
this->button1->Name = L"button1";
this->button1->Size =
System::Drawing ::Size(75, 23);
this->button1->TabIndex = 4;
this->button1->Text = L"NEXT";
//
// Form1
//
this->AutoScaleDimen sions =
System::Drawing ::SizeF(6, 13);
this->AutoScaleMod e =
System::Windows ::Forms::AutoSc aleMode::Font;
this->ClientSize = System::Drawing ::Size(292,
266);
this->Controls->Add(this->button1);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->pictureBox1) ;
this->Controls->Add(this->trackBar1);
this->Name = L"Form1";
this->Text = L"Form1";
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->trackBar1))->EndInit();[/color]
(cli::safe_cast <System::Compon entModel::ISupp ortInitialize^[color=blue]
>(this->pictureBox1) )->EndInit();[/color]
this->ResumeLayout(f alse);
this->PerformLayout( );
}
#pragma endregion
};
}
Comment