Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Agenda - Agenda.frm

Agenda.frm

Caricato da: Antometal
Scarica il programma completo

  1. Option Explicit
  2. Public GiornoMeseAnno As String
  3. Public XCorso1 As String
  4. Public XCorso2 As String
  5. Public XCorso3 As String
  6. Public Salvato As Boolean
  7.  
  8. Private Sub Salva(Dove As String)
  9. Dim FileNumber As Integer
  10. FileNumber = FreeFile
  11. Open Dove For Output As #FileNumber
  12. Print #FileNumber, txtNote.Text
  13. Close #FileNumber
  14. Salvato = True
  15. End Sub
  16.  
  17. Private Sub Apri(Dove As String)
  18. On Error GoTo Esci
  19. Dim FileNumber As Integer
  20. Dim LineA As String
  21. FileNumber = FreeFile
  22. Open Dove For Input As FileNumber
  23.     Do
  24.         Input #FileNumber, LineA
  25.         txtNote.Text = txtNote.Text & LineA & vbCrLf
  26.     Loop Until EOF(1) = True
  27. Close #FileNumber
  28. Exit Sub
  29. Esci:
  30. End Sub
  31.  
  32. Private Sub accDiffrenza_Click()
  33. SecondarioAccessori.Show
  34. End Sub
  35.  
  36. Private Sub accGiorno_Click()
  37. Dim DataGiorno As String
  38. DataGiorno = InputBox("Inserisci la data per sapere il nome del giorno" & String(3, vbCrLf) & "Formato data:" & String(4, vbTab) & "gg\mm\aaaa", , Date)
  39.     If IsDate(DataGiorno) = False Then GoTo NOData
  40. MsgBox Format(DataGiorno, "dddd dd mmmm-mm yyyy")
  41. Exit Sub
  42. NOData:
  43. MsgBox "Errore, dati inseirti non corretti" & vbCrLf & vbCrLf & "Inserisci la data in formato:   gg\mm\aaaa", vbOKOnly + vbCritical
  44. End Sub
  45.  
  46. Private Sub Accessori_Click()
  47. SecondarioAccessori.Show
  48. End Sub
  49.  
  50. Private Sub Calendar_Click()
  51. On Error Resume Next
  52. GiornoMeseAnno = Format(Calendar, "dddd dd  mmmm  yyyy") & ".txt"
  53. XCorso1 = "C:\Calendario"
  54. XCorso2 = "C:\Calendario\" & Format(Calendar, "mmmm")
  55. XCorso3 = "C:\Calendario\" & Format(Calendar, "mmmm") & "\" & Format(Calendar, "dddd dd")
  56. Apri (XCorso3 & "\" & GiornoMeseAnno)
  57. txtNote.SetFocus
  58. End Sub
  59.  
  60. Private Sub flEnd_Click()
  61. Form_Unload (0)
  62. End Sub
  63.  
  64. Private Sub flSave_Click()
  65. On Error Resume Next
  66. MkDir (XCorso1)
  67. MkDir (XCorso2)
  68. MkDir (XCorso3)
  69. Salva (XCorso3 & "\" & GiornoMeseAnno)
  70. End Sub
  71.  
  72. Private Sub Form_Load()
  73. Calendar.Today
  74. Calendar_Click
  75. CDialog.Flags = cdlCCFullOpen
  76. Salvato = True
  77. End Sub
  78.  
  79. Private Sub Form_Unload(Cancel As Integer)
  80. Dim Uscita As VbMsgBoxResult
  81.     If Salvato = False Then
  82.         Uscita = MsgBox("Il testo del file è stato cambiato" & vbCrLf & "Salvare le modifiche apportate al documento e poi uscire?", vbExclamation + vbYesNoCancel)
  83.             If Uscita = vbYes Then Salva (XCorso3 & "\" & GiornoMeseAnno)
  84.             If Uscita = vbCancel Then Cancel = 1
  85.             If Uscita = vbNo Or Uscita = vbYes Then Unload SecondarioAccessori
  86.     Else: End
  87.     End If
  88. End Sub
  89.  
  90. Private Sub GoToday_Click()
  91. Calendar.Today
  92. End Sub
  93.  
  94. Private Sub insData_Click()
  95. txtNote.Text = txtNote.Text & Date
  96. txtNote.SelStart = Len(txtNote)
  97. End Sub
  98.  
  99. Private Sub insDataOra_Click()
  100. txtNote.Text = txtNote.Text & Now
  101. txtNote.SelStart = Len(txtNote)
  102. End Sub
  103.  
  104. Private Sub insOra_Click()
  105. txtNote.Text = txtNote.Text & Time
  106. txtNote.SelStart = Len(txtNote)
  107. End Sub
  108.  
  109. Private Sub modChar_Click()
  110.     With CDialog
  111.         .FontName = txtNote.Font.Name
  112.         .FontSize = txtNote.Font.Size
  113.         .FontBold = txtNote.Font.Bold
  114.         .FontItalic = txtNote.Font.Italic
  115.         .FontStrikethru = txtNote.Font.Strikethrough
  116.         .FontUnderline = txtNote.Font.Underline
  117.     End With
  118. CDialog.ShowFont
  119.     With txtNote
  120.         .Font.Name = CDialog.FontName
  121.         .Font.Size = CDialog.FontSize
  122.         .Font.Bold = CDialog.FontBold
  123.         .Font.Italic = CDialog.FontItalic
  124.         .Font.Strikethrough = CDialog.FontStrikethru
  125.         .Font.Underline = CDialog.FontUnderline
  126.     End With
  127. End Sub
  128.  
  129. Private Sub txtNote_Change()
  130. Salvato = False
  131. End Sub