Page 41 - Programming VB.NET
P. 41
Code With VB.Net 37
Table 3.2 Plan the Event Procedures
Procedure Action
btnarea Calculate an area of
circle
Private Sub btnarea_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles btnarea.Click
Const pi As Double = 3.1415
Dim r As Double
Dim area As Double
r = txtradius.Text
area = pi * r * r
lblarea.Text = area
End Sub