Vous êtes sur la page 1sur 2

VERSION 5.

00
Begin VB.Form FrmEdad
BorderStyle = 3 'Fixed Dialog
Caption = "Calcula la edad de una persona"
ClientHeight = 2415
ClientLeft = 45
ClientTop = 435
ClientWidth = 5160
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2415
ScaleWidth = 5160
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton CmdSalir
Cancel = -1 'True
Caption = "&Salir"
Height = 375
Left = 3480
TabIndex = 6
Top = 1800
Width = 1215
End
Begin VB.CommandButton CmdLimpiar
Caption = "&Limpiar"
Height = 375
Left = 1920
TabIndex = 5
Top = 1800
Width = 1335
End
Begin VB.CommandButton CmdAceptar
Caption = "&Aceptar"
Default = -1 'True
Height = 375
Left = 480
TabIndex = 4
Top = 1800
Width = 1215
End
Begin VB.TextBox TxtEdad
Height = 375
Left = 2760
Locked = -1 'True
TabIndex = 3
Top = 960
Width = 1935
End
Begin VB.TextBox TxtFecNac
Height = 375
Left = 2760
TabIndex = 2
Top = 240
Width = 1935
End
Begin VB.Label LblEdad
AutoSize = -1 'True
Caption = "Su edad es:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 1440
TabIndex = 1
Top = 1080
Width = 1035
End
Begin VB.Label LdlFecNac
AutoSize = -1 'True
Caption = "Fecha de nacimiento:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 720
TabIndex = 0
Top = 360
Width = 1845
End
End
Attribute VB_Name = "FrmEdad"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdAceptar_Click()
Dim FecNac As Date, Edad As Integer
FecNac = CDate(TxtFecNac)
Edad = CInt((Date - FecNac) / 365)
TxtEdad = Str(Edad) & "a�os"
End Sub

Private Sub CmdLimpiar_Click()


TxtFecNac = ""
TxtEdad = ""
TxtFecNac.SetFocus

End Sub

Private Sub CmdSalir_Click()


End
End Sub

Vous aimerez peut-être aussi