System::Void btnGenerate_Click(System::Object^ sender,
System::EventArgs^ e)
{
double monday = double::Parse(this->txtMonday->Text) / 100;
double tuesday = double::Parse(this->txtTuesday->Text) / 100;
double wednesday = double::Parse(this->txtWednesday->Text) / 100;
double thursday = double::Parse(this->txtThursday->Text) / 100;
double friday = double::Parse(this->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(gcnew 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();
}
|