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
mydvdlist - Frmdvd.frm

Frmdvd.frm

Caricato da: Albertking82
Scarica il programma completo

  1. Option Explicit
  2. Public cont As Integer
  3. Public stringa As String
  4. Public Sub pulisci()
  5.  txtanno.Text = ""
  6.  Txttitolo.Text = ""
  7.  Txtregista.Text = ""
  8.  Txtgenere.Text = ""
  9.  Txtattore.Text = ""
  10.  txtNazionalità.Text = ""
  11.  End Sub
  12.  
  13. Private Sub Form_Load()
  14. Dim n As Integer, g As Integer
  15. n = FreeFile
  16. g = FreeFile
  17. Open "c:\numero.dat" For Random As #g
  18. Close #g
  19. Open percorso For Random As #n
  20. Close #n
  21. End Sub
  22.  
  23. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  24.  If MsgBox("Sei sicuro di voler uscire dal programma?", vbQuestion + vbYesNoCancel, "Esci") = vbYes Then
  25.     MsgBox "Programma eseguito da Albert King", vbInformation, "Creatore"
  26.     End
  27.     Else
  28.     Cancel = True
  29.  End If
  30. End Sub
  31.  
  32. Private Sub Image1_Click()
  33. Frmdvd.WindowState = 1
  34. Call Label8_Click
  35.  
  36. End Sub
  37.  
  38. Private Sub Image2_Click()
  39.   Dim numfile As Integer
  40.      numfile = FreeFile
  41.      Frmprofilo.lbltitolo.Caption = Frmprofilo.lbltitolo.Caption & Trim(LCase(Txttitolo.Text))
  42.      Frmprofilo.Lblregista.Caption = Frmprofilo.Lblregista.Caption & Trim(LCase(Txtregista.Text))
  43.      Frmprofilo.Lblattore.Caption = Frmprofilo.Lblattore.Caption & Trim(LCase(Txtattore.Text))
  44.      Frmprofilo.Lblgenere.Caption = Frmprofilo.Lblgenere.Caption & Trim(LCase(Txtgenere.Text))
  45.      Frmprofilo.lblanno.Caption = Frmprofilo.lblanno.Caption & Trim(LCase(txtanno.Text))
  46.       If Optscarso.Value = True Then
  47.       Frmprofilo.lblvoto.Caption = Frmprofilo.lblvoto.Caption & "scarso"
  48.       End If
  49.       If Optdiscreto.Value = True Then
  50.       Frmprofilo.lblvoto.Caption = Frmprofilo.lblvoto.Caption & "discreto"
  51.       End If
  52.       If Optbuono.Value = True Then
  53.       Frmprofilo.lblvoto.Caption = Frmprofilo.lblvoto.Caption & "buono"
  54.       End If
  55.       If Optottimo.Value = True Then
  56.       Frmprofilo.lblvoto.Caption = Frmprofilo.lblvoto.Caption & "ottimo"
  57.       End If
  58.       If Optcapolavoro.Value = True Then
  59.       Frmprofilo.lblvoto.Caption = Frmprofilo.lblvoto.Caption & "geniale"
  60.       End If
  61.            Frmprofilo.lblnazion.Caption = Frmprofilo.lblnazion.Caption & Trim(LCase(txtNazionalità.Text))
  62.   If txtanno.Text <> "" And Txttitolo.Text <> "" And Txtregista.Text <> "" _
  63.   And Txtattore.Text <> "" And Txtgenere.Text <> "" And txtNazionalità.Text <> "" Then
  64.       Frmprofilo.Show
  65.       If MsgBox("Sei sicuro di voler salvare i dati nel database?", vbQuestion + vbYesNoCancel, "Salva") = vbYes Then
  66.      cont = cont + 1
  67.     ReDim Preserve film(1 To cont) As dvd
  68.       film(cont).titolo = Trim(LCase(Txttitolo.Text))
  69.       film(cont).regista = Trim(LCase(Txtregista.Text))
  70.       film(cont).attoreprotagonista = Trim(LCase(Txtattore.Text))
  71.       film(cont).nazionalità = Trim(LCase(txtNazionalità.Text))
  72.       film(cont).genere = Trim(LCase(Txtgenere.Text))
  73.       film(cont).annodiproduzione = Trim(LCase(txtanno.Text))
  74.       If Optscarso.Value = True Then
  75.       film(cont).voto = "scarso"
  76.       End If
  77.       If Optdiscreto.Value = True Then
  78.       film(cont).voto = "discreto"
  79.       End If
  80.       If Optbuono.Value = True Then
  81.       film(cont).voto = "buono"
  82.       End If
  83.       If Optottimo.Value = True Then
  84.       film(cont).voto = "ottimo"
  85.       End If
  86.       If Optcapolavoro.Value = True Then
  87.       film(cont).voto = "geniale"
  88.       End If
  89.       stringa = " " & film(cont).titolo & film(cont).regista & film(cont).attoreprotagonista _
  90.                 & film(cont).annodiproduzione & "         " & film(cont).nazionalità & film(cont).genere & "    " & film(cont).voto
  91.       Open percorso For Append As #numfile
  92.       Print #numfile, stringa
  93.       Close #numfile
  94.       Call pulisci
  95.       End If
  96.      Unload Frmprofilo
  97.   Else
  98.       MsgBox "Devi specificare tutti i campi!", vbInformation, "Info"
  99.   End If
  100. End Sub
  101.  
  102. Private Sub Label10_Click()
  103. frmking.Show
  104. End Sub
  105.  
  106. Private Sub Label8_Click()
  107.  Dim num As Integer
  108.  Dim strlinea As String
  109.  Frmdvd.WindowState = 1
  110.   num = FreeFile
  111.      Open percorso For Input As #num
  112.      While Not EOF(num)
  113.       Line Input #num, strlinea
  114.       frmLista.List1.AddItem strlinea
  115.       Wend
  116.       Close #num
  117. frmLista.Show
  118. End Sub
  119.  
  120. Private Sub Label9_Click()
  121. frmking.Show
  122. End Sub
  123.  
  124. Private Sub txtanno_Change()
  125.   If Not IsNumeric(txtanno.Text) Then
  126.      txtanno.Text = ""
  127.   End If
  128. End Sub