Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As _
             System.EventArgs) Handles btnCalc.Click
  Dim Number As Double
 
  Number = CDbl(txtNumber.Text) 
  If Number > 1000 Then
    Beep()
    MessageBox.Show("Program obsługuje tylko wartości od 1 do 1000")
    txtNumber.Focus()
  End If
  txtSquare.Text = CStr(Values(Number, 2))
  txtRoot.Text = Format(Values(Number, 1), "##.#######")
End Sub
