Private Sub DrawAxes(ByVal g As Graphics)
'Note that intXOrigin and intYOrigin is declared as a field variable (class level)
intXOrigin = [Link] \ 2 'Calculates the x-origin, half of PicDraw Width
intYOrigin = [Link] \ 2 'Claculates the y-origin, half of PicDraw Height
Dim myfont As New Font("Arial", 8, [Link])
[Link]([Link])
[Link]([Link], 0, intYOrigin, [Link], intYOrigin) 'draw x-axis
[Link]([Link], intXOrigin, 0, intXOrigin, [Link]) 'draw y-axis
[Link]("(0, 0)", myfont, [Link], intXOrigin, intYOrigin) 'add label to origin
If blnPlot = False Then
[Link]("This program plots the general function" _
& vbNewLine & "y = (Cx)^(1/N)" _
& vbNewLine & "Please input the appropirate values of C and N" _
& vbNewLine & "to the respective textboxes", myfont, [Link], 0, 0) 'add
instruction
Else
[Link]("graph of the function" _
& vbNewLine & "y = (" & sngC & "x)^(1/" & sngN & ")", _
myfont, [Link], 0, 0) 'adds function label to the graph
End If
End Sub
Private Sub Form1_Resize(sender As Object, e As [Link]) Handles [Link]
[Link]() 'for resizing
End Sub
Private Sub btnPlot_Click(sender As [Link], e As [Link]) Handles
[Link]
Try
sngN = [Link]
sngC = [Link]
If sngC < 0 Then 'just a checker for C
[Link]("The constant, C, should be greater than or equal to zero.")
Else 'if everything is right
blnPlot = True
[Link]()
End If
Catch ex As Exception 'oops, something went wrong. ^_^
[Link]([Link])
End Try
End Sub
Private Sub btnReset_Click(sender As [Link], e As [Link]) Handles
[Link]
'Just to reset everything
blnPlot = False
[Link]()
[Link]()
[Link]()
End Sub
End Class