Private Sub btnGenerateClick(ByVal sender As Object,
ByVal e As System.EventArgs)
Handles btnGenerate.Click
Dim Monday As Integer
Dim Tuesday As Integer
Dim Wednesday As Integer
Dim Thursday As Integer
Dim Friday As Integer
Try
Monday = CInt(txtMonday.Text) / 100
Catch
MsgBox("Invalid value")
End Try
Try
Tuesday = CInt(txtTuesday.Text) / 100
Catch
MsgBox("Invalid value")
End Try
Try
Wednesday = CInt(txtWednesday.Text) / 100
Catch
MsgBox("Invalid value")
End Try
Try
Thursday = CInt(txtThursday.Text) / 100
Catch
MsgBox("Invalid value")
End Try
Try
Friday = CInt(txtFriday.Text) / 100
Catch
MsgBox("Invalid value")
End Try
GraphDrawingArea.Clear(BackColor)
GraphDrawingArea.FillRectangle(New SolidBrush(Color.Red),
txtMonday.Left + 5,
280 - monday, 40, monday)
GraphDrawingArea.DrawRectangle(New Pen(Color.Black),
txtMonday.Left + 5,
280 - monday, 40, monday)
GraphDrawingArea.FillRectangle(New SolidBrush(Color.Blue),
txtTuesday.Left + 5,
280 - tuesday, 40, tuesday)
GraphDrawingArea.DrawRectangle(New Pen(Color.Black),
txtTuesday.Left + 5,
280 - tuesday, 40, tuesday)
GraphDrawingArea.FillRectangle(New SolidBrush(Color.Fuchsia),
txtWednesday.Left + 5,
280 - wednesday, 40, wednesday)
GraphDrawingArea.DrawRectangle(New Pen(Color.Black),
txtWednesday.Left + 5,
280 - wednesday, 40, wednesday)
GraphDrawingArea.FillRectangle(New SolidBrush(Color.Brown),
txtThursday.Left + 5,
280 - thursday, 40, thursday)
GraphDrawingArea.DrawRectangle(New Pen(Color.Black),
txtThursday.Left + 5,
280 - thursday, 40, thursday)
GraphDrawingArea.FillRectangle(New SolidBrush(Color.Turquoise),
txtFriday.Left + 5,
280 - friday, 40, friday)
GraphDrawingArea.DrawRectangle(New Pen(Color.Black),
txtFriday.Left + 5,
280 - friday, 40, friday)
GraphDrawingArea.DrawRectangle(New Pen(Color.Black),
10, 280, Width - 30, 1)
Invalidate()
End Sub
|