io userei Savesetting e getsetting per memorizzare una variabile.
aumenterei la variabile ad ogni apertura del programma fino ad un valore limite da me impostato.
immetti in numero il numero massimo di aperture del tuo programmino...codice:Private Sub Form_Load() numero = 3 On Error GoTo salvavariabile a = GetSetting(appname:="c:/ciao.exe", section:="Startup", Key:="hallo") a = a + 1 SaveSetting appname:="c:/ciao.exe", section:="Startup", Key:="hallo", setting:=a If a > numero Then msgbox "tempo di prova scaduto" Unload Me End If GoTo fine: salvavariabile: SaveSetting appname:="c:/ciao.exe", section:="Startup", Key:="hallo", setting:="0" fine: End Sub

Rispondi quotando