[text] ffaj;l;kjfagk

Viewer

copydownloadembedprintName: ffaj;l;kjfagk
  1.  On Error GoTo MsgDisplay
  2.         txtOutput.Text = txtOne.Text / txtTwo.Text
  3.         Throw New Exception()
  4.  
  5. MsgDisplay:
  6.         If (TypeOf Err.GetException() Is System.InvalidCastException) Then
  7.             MsgBox("You can only divide numbers")
  8.         End If
  9.         If (TypeOf Err.GetException() Is System.DivideByZeroException) Then
  10.             MsgBox("You cannot divide number by zero.")
  11.         End If
  12.     End Sub
  13.  
  14.     Private Sub txtOne_TextChanged(sender As Object, e As EventArgs) Handles txtOne.TextChanged
  15.  
  16.     End Sub
  17.  
  18.     Private Sub txtOne_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtOne.KeyPress
  19.         If Not Char.IsDigit(e.KeyChar) AndAlso Not Char.IsControl(e.KeyChar) Then
  20.             e.Handled = True
  21.         End If
  22.     End Sub
  23.  
  24.     Private Sub txtTwo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTwo.KeyPress
  25.         If Not Char.IsDigit(e.KeyChar) AndAlso Not Char.IsControl(e.KeyChar) Then
  26.             e.Handled = True
  27.         End If
  28.     End Sub

Editor

You can edit this paste and save as new:


File Description
  • ffaj;l;kjfagk
  • Paste Code
  • 18 Sep-2021
  • 1 Kb
You can Share it: