En la practica se muestra la cajas de texto donde se ver las notas que ha escrito el usuario. Cada caja de texto tiene un label donde muestra el dia de cada mes. Tambien hemos puesto un label arriba para poner los dias de Lunes a Domingo.
Despues creamos el menu Calendario en la barra de herraminetas donde se muetra el calendario. También creamos el menu de Meses para cuendo seleccionamos un mes el programa se modifique y muestre los dias de cada mes. Despues ponemos un menu de fecha y hora para mostrar la fecha y la hora actual y finalmente un menu de About donde se muestra nuestros datos.

Despues hemos puesto un Text Box donde el usuario cuando cliquee dos veces en un text box se muestre la caja de texto y escriba lo que el quiera y que cuando cliquee dos veces en la misma caja de texto creada, desaparezca y que se muestre en el Text Box elegido lo que ha escrito.

Despues haremos un formualrio nuevo donde pondremos los objetos para poder interactuar con una base de datos, para que cuando el usuario escriba en el calendario se guarde en la tabla de la base de datos.
Aqui se muestra todo el codigo del programa para que el todo el programa funcione correctamente.
Dim indice As Integer
Dim mes As Integer
Private Sub Command1_Click()
FBD.Show
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
mes = 0
leerdatos
inicializar
End Sub
Private Sub leerdatos()
FBD.Show
FBD.DataGrid1.Row = mes
For i = 0 To 30
Tx1(i).Text = FBD.DataGrid1.Columns(i + 2)
Next
Unload FBD
End Sub
Private Sub escribirdatos()
FBD.Show
FBD.DataGrid1.Row = mes
For i = 0 To 30
FBD.DataGrid1.Columns(i + 2) = Tx1(i).Text
Next
Unload FBD
End Sub
Private Sub M_Click(Index As Integer)
mes = Index
If (mes = 0 Or mes = 2 Or mes = 4 Or mes = 6 Or mes = 7 Or mes = 9 Or mes = 11) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
If (mes = 3 Or mes = 5 Or mes = 8 Or mes = 10) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
If (mes = 1) Then
Tx1(28).Visible = True
Tx1(29).Visible = False
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = False
Label(30).Visible = False
End If
leerdatos
End Sub
Private Sub Menu1_Click()
Form1.Show
End Sub
Private Sub Menu2_Click()
If Lfecha.Visible = True Then
Lfecha.Visible = False
Else
Lfecha.Visible = True
End If
If Lhora.Visible = True Then
Lhora.Visible = False
Else
Lhora.Visible = True
End If
End Sub
Private Sub Menu3_Click()
If Calendar1.Visible = True Then
Calendar1.Visible = False
Else
Calendar1.Visible = True
End If
End Sub
Private Sub Mese10_Click(Index As Integer)
If (Index = 10) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Mese2_Click(Index As Integer)
Fagenda.Caption = Mese2(Index).Caption
If (Index = 0) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
mes = Index
leerdatos
End Sub
Private Sub Mese3_Click(Index As Integer)
Fagenda.Caption = Mese3(Index).Caption
If (Index = 3) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Mese4_Click(Index As Integer)
Fagenda.Caption = Mese4(Index).Caption
If (Index = 4) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Mese9_Click(Index As Integer)
If (Index = 9) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses0_Click(Index As Integer)
Fagenda.Caption = Meses0(Index).Caption
If (Index = 0) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
If (Index = 1) Then
Tx1(28).Visible = True
Tx1(29).Visible = False
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = False
Label(30).Visible = False
End If
If (Index = 3) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub inicializar()
For i = 0 To 30
Label(i).Caption = i + 1
Next
End Sub
Private Sub Meses1_Click(Index As Integer)
Fagenda.Caption = Meses1(Index).Caption
Tx1(28).Visible = False
Tx1(29).Visible = False
Tx1(30).Visible = False
Label(28).Visible = False
Label(29).Visible = False
Label(30).Visible = False
End Sub
Private Sub Meses11_Click(Index As Integer)
If (Index = 11) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses5_Click(Index As Integer)
Fagenda.Caption = Meses5(Index).Caption
If (Index = 5) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Meses6_Click(Index As Integer)
If (Index = 6) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses7_Click(Index As Integer)
If (Index = 7) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses8_Click(Index As Integer)
If (Index = 8) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Timer1_Timer()
Lfecha.Caption = Date
Lhora.Caption = Time
End Sub
Private Sub Tx1_DblClick(Index As Integer)
TXnotas.Visible = True
indice = Index
TXnotas.Text = Tx1(indice).Text
End Sub
Private Sub TXnotas_DblClick()
TXnotas.Visible = False
Tx1(indice).Text = TXnotas.Text
escribirdatos
End Sub
Dim indice As Integer
Dim mes As Integer
Private Sub Command1_Click()
FBD.Show
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
mes = 0
leerdatos
inicializar
End Sub
Private Sub leerdatos()
FBD.Show
FBD.DataGrid1.Row = mes
For i = 0 To 30
Tx1(i).Text = FBD.DataGrid1.Columns(i + 2)
Next
Unload FBD
End Sub
Private Sub escribirdatos()
FBD.Show
FBD.DataGrid1.Row = mes
For i = 0 To 30
FBD.DataGrid1.Columns(i + 2) = Tx1(i).Text
Next
Unload FBD
End Sub
Private Sub M_Click(Index As Integer)
mes = Index
If (mes = 0 Or mes = 2 Or mes = 4 Or mes = 6 Or mes = 7 Or mes = 9 Or mes = 11) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
If (mes = 3 Or mes = 5 Or mes = 8 Or mes = 10) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
If (mes = 1) Then
Tx1(28).Visible = True
Tx1(29).Visible = False
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = False
Label(30).Visible = False
End If
leerdatos
End Sub
Private Sub Menu1_Click()
Form1.Show
End Sub
Private Sub Menu2_Click()
If Lfecha.Visible = True Then
Lfecha.Visible = False
Else
Lfecha.Visible = True
End If
If Lhora.Visible = True Then
Lhora.Visible = False
Else
Lhora.Visible = True
End If
End Sub
Private Sub Menu3_Click()
If Calendar1.Visible = True Then
Calendar1.Visible = False
Else
Calendar1.Visible = True
End If
End Sub
Private Sub Mese10_Click(Index As Integer)
If (Index = 10) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Mese2_Click(Index As Integer)
Fagenda.Caption = Mese2(Index).Caption
If (Index = 0) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
mes = Index
leerdatos
End Sub
Private Sub Mese3_Click(Index As Integer)
Fagenda.Caption = Mese3(Index).Caption
If (Index = 3) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Mese4_Click(Index As Integer)
Fagenda.Caption = Mese4(Index).Caption
If (Index = 4) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Mese9_Click(Index As Integer)
If (Index = 9) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses0_Click(Index As Integer)
Fagenda.Caption = Meses0(Index).Caption
If (Index = 0) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
If (Index = 1) Then
Tx1(28).Visible = True
Tx1(29).Visible = False
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = False
Label(30).Visible = False
End If
If (Index = 3) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub inicializar()
For i = 0 To 30
Label(i).Caption = i + 1
Next
End Sub
Private Sub Meses1_Click(Index As Integer)
Fagenda.Caption = Meses1(Index).Caption
Tx1(28).Visible = False
Tx1(29).Visible = False
Tx1(30).Visible = False
Label(28).Visible = False
Label(29).Visible = False
Label(30).Visible = False
End Sub
Private Sub Meses11_Click(Index As Integer)
If (Index = 11) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses5_Click(Index As Integer)
Fagenda.Caption = Meses5(Index).Caption
If (Index = 5) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Meses6_Click(Index As Integer)
If (Index = 6) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses7_Click(Index As Integer)
If (Index = 7) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = True
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = True
End If
End Sub
Private Sub Meses8_Click(Index As Integer)
If (Index = 8) Then
Tx1(28).Visible = True
Tx1(29).Visible = True
Tx1(30).Visible = False
Label(28).Visible = True
Label(29).Visible = True
Label(30).Visible = False
End If
End Sub
Private Sub Timer1_Timer()
Lfecha.Caption = Date
Lhora.Caption = Time
End Sub
Private Sub Tx1_DblClick(Index As Integer)
TXnotas.Visible = True
indice = Index
TXnotas.Text = Tx1(indice).Text
End Sub
Private Sub TXnotas_DblClick()
TXnotas.Visible = False
Tx1(indice).Text = TXnotas.Text
escribirdatos
End Sub
No hay comentarios:
Publicar un comentario