Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/10/2012, 21:02
Lain0x
 
Fecha de Ingreso: febrero-2008
Mensajes: 78
Antigüedad: 16 años, 2 meses
Puntos: 0
Capturando subcadenas

Hola estoy haciendo un programa que muestra la fecha, y después captura el día, mes y año y los imprime en textbox por separado al momento de presionar un botón.
El programa hace lo que quiero, pero muestra algunas excepciones abajo.

Código del botón:

Código:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      
        Dim c As String
        c = Date.Today
        T1.Text = c
        T2.Text = Mid(c, 1, Len(c) - 8)
        T3.Text = Mid(c, 4, Len(c) - 8)
        T4.Text = Mid(c, 7, Len(c) - 6)
        
    End Sub

Se ejecuta perfecto pero muestra esto abajo:

A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll