Dim arr1() As String
Dim arr2() As String
Dim intY As Integer
Dim intM As Integer
TextBox1.Text = TextBox1.Text.Trim
If Not TextBox1.Text.Contains(".") Then
TextBox1.Text += "."
End If
TextBox2.Text = TextBox2.Text.Trim
If Not TextBox2.Text.Contains(".") Then
TextBox2.Text += "."
End If
arr1 = TextBox1.Text.Split(CChar("."))
arr2 = TextBox2.Text.Split(CChar("."))
Try
intY = CInt(arr1(0)) + CInt(arr2(0))
intM = CInt(arr1(1)) + CInt(arr2(1))
Catch ex As Exception
MessageBox.Show("One of the inputs is not a numeric", "Error", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Finally
If intM > 11 Then
intY += intM \ 12
intM -= (intM \ 12) * 12
End If
TextBox3.Text = Format(intY, "###") & "." & Format(intM, "##")
End Try