1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
this->label6->Text = L"Starts";
//
// label7
//
this->label7->AutoSize = true;
this->label7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label7->Location = System::Drawing::Point(4, 166);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(86, 20);
this->label7->TabIndex = 6;
this->label7->Text = L"First Name";
//
// label8
//
this->label8->AutoSize = true;
this->label8->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label8->Location = System::Drawing::Point(4, 196);
this->label8->Name = L"label8";
this->label8->Size = System::Drawing::Size(86, 20);
this->label8->TabIndex = 7;
this->label8->Text = L"Last Name";
this->label8->Click += gcnew System::EventHandler(this, &MyForm::label8_Click);
//
// textBox1
//
this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox1->Location = System::Drawing::Point(96, 34);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(219, 26);
this->textBox1->TabIndex = 8;
this->textBox1->Text = L"textBoxID";
//
// textBox2
//
this->textBox2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox2->Location = System::Drawing::Point(96, 61);
this->textBox2->Name = L"textBox2";
this->textBox2->Size = System::Drawing::Size(219, 26);
this->textBox2->TabIndex = 9;
this->textBox2->Text = L"textBoxAmount";
//
// textBox3
//
this->textBox3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox3->Location = System::Drawing::Point(96, 87);
this->textBox3->Name = L"textBox3";
this->textBox3->Size = System::Drawing::Size(219, 26);
this->textBox3->TabIndex = 10;
this->textBox3->Text = L"textBoxType";
//
// textBox4
//
this->textBox4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox4->Location = System::Drawing::Point(96, 114);
this->textBox4->Name = L"textBox4";
this->textBox4->Size = System::Drawing::Size(219, 26);
this->textBox4->TabIndex = 11;
this->textBox4->Text = L"textBoxLength";
//
// textBox5
//
this->textBox5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox5->Location = System::Drawing::Point(96, 141);
this->textBox5->Name = L"textBox5";
this->textBox5->Size = System::Drawing::Size(219, 26);
this->textBox5->TabIndex = 12;
this->textBox5->Text = L"textBoxStarts";
//
// textBox6
//
this->textBox6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox6->Location = System::Drawing::Point(96, 166);
this->textBox6->Name = L"textBox6";
this->textBox6->Size = System::Drawing::Size(219, 26);
this->textBox6->TabIndex = 13;
this->textBox6->Text = L"textBoxFirstName";
//
// textBox7
//
this->textBox7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox7->Location = System::Drawing::Point(96, 193);
this->textBox7->Name = L"textBox7";
this->textBox7->Size = System::Drawing::Size(219, 26);
this->textBox7->TabIndex = 14;
this->textBox7->Text = L"textBoxLastName";
//
// button1
//
this->button1->Location = System::Drawing::Point(96, 225);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 15;
this->button1->Text = L"< Previous";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click);
//
// button2
//
this->button2->Location = System::Drawing::Point(240, 225);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(75, 23);
this->button2->TabIndex = 16;
this->button2->Text = L"Next >";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click);
//
// MyForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(555, 249);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Controls->Add(this->textBox7);
this->Controls->Add(this->textBox6);
this->Controls->Add(this->textBox5);
this->Controls->Add(this->textBox4);
this->Controls->Add(this->textBox3);
this->Controls->Add(this->textBox2);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label8);
this->Controls->Add(this->label7);
this->Controls->Add(this->label6);
this->Controls->Add(this->label5);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Name = L"MyForm";
this->Text = L"Scholarships";
this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void label8_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void label2_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
fillFormFields(0);
}
private: System::Void label1_DoubleClick(System::Object^ sender, System::EventArgs^ e) {
}
void fillFormFields(int p)
{
static int i = 0; // Keeps track of which record we are on
i += p; // changes the current record
string sFileLine; // a string to read in each line of the file
vector<string> sParsedLine; // array to hold the parsed line from file
vector<Scholarship> s; // This array of objects is initialized using
// Open input and output files and test to make sure they openned correctly
ifstream fin;
ofstream fout;
OpenFiles(fin, fout);
while (!fin.eof())
// Read a line from the file and push onto end of scholars object array
s.push_back(readFile(sFileLine, sParsedLine, fin));
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
fillFormFields(-1);
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
fillFormFields(1);
}
};
}
|