System::Void btnGenerate_Click(System::Object ^ sender,
System::EventArgs ^ e)
{
int monday = int::Parse(txtMonday->Text) / 100;
int tuesday = int::Parse(txtTuesday->Text) / 100;
int wednesday = int::Parse(txtWednesday->Text) / 100;
int thursday = int::Parse(txtThursday->Text) / 100;
int friday = int::Parse(txtFriday->Text) / 100;
graphDrawingArea->Clear(this->BackColor);
graphDrawingArea->FillRectangle(gcnew SolidBrush(Color::Red),
this->txtMonday->Left+5,
280-monday, 40, monday);
graphDrawingArea->DrawRectangle(gcnew Pen(Color::Black),
this->txtMonday->Left+5,
280-monday, 40, monday);
graphDrawingArea->FillRectangle(gcnew SolidBrush(Color::Blue),
this->txtTuesday->Left+5,
280-tuesday, 40, tuesday);
graphDrawingArea->DrawRectangle(gcnew Pen(Color::Black),
this->txtTuesday->Left+5,
280-tuesday, 40, tuesday);
graphDrawingArea->FillRectangle(gcnew SolidBrush(Color::Fuchsia),
this->txtWednesday->Left+5,
280-wednesday, 40, wednesday);
graphDrawingArea->DrawRectangle(gcnew Pen(Color::Black),
this->txtWednesday->Left+5,
280-wednesday, 40, wednesday);
graphDrawingArea->FillRectangle(new SolidBrush(Color::Brown),
this->txtThursday->Left+5,
280-thursday, 40, thursday);
graphDrawingArea->DrawRectangle(gcnew Pen(Color::Black),
this->txtThursday->Left+5,
280-thursday, 40, thursday);
graphDrawingArea->FillRectangle(gcnew SolidBrush(Color::Turquoise),
this->txtFriday->Left+5,
280-friday, 40, friday);
graphDrawingArea->DrawRectangle(gcnew Pen(Color::Black),
this->txtFriday->Left+5,
280-friday, 40, friday);
graphDrawingArea->DrawRectangle(gcnew Pen(Color::Black),
10, 280, Width - 30, 1);
Invalidate();
}
|