begin process at 2010 03 20 03:53:32
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Control

 > DÉCLENCHER UNE ACTION À UN MOMENT PRÉCIS POUR UNE DURÉE DÉTERMINÉE

DÉCLENCHER UNE ACTION À UN MOMENT PRÉCIS POUR UNE DURÉE DÉTERMINÉE


 Information sur la source

Note :
1 / 10 - par 1 personne
1,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Control Niveau :Débutant Date de création :02/10/2003 Vu :2 230

Auteur : Sibelle07

Ecrire un message privé
Site perso
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Voila ! Tout est expliqué dans le code il vous faut :
-un timer
-un form
-3 boutons

Source

  • Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
  • Dim drapeau As Integer, heure_f As Integer, minute_f As Integer, drapeau1 As Integer, tempo As Integer, limite0 As Integer
  • Dim limite As String
  • Sub Commande1_Click ()
  • h$ = Now
  • bon% = 0
  • fin$ = Texte1.Text
  • If Len(fin$) <> 5 Then
  • bon% = 1
  • Else
  • If Asc(Mid$(fin$, 5, 1)) > 57 Or Asc(Mid$(fin$, 5, 1)) < 48 Then
  • bon% = 1
  • End If
  • If Asc(Mid$(fin$, 4, 1)) > 57 Or Asc(Mid$(fin$, 4, 1)) < 48 Then
  • bon% = 1
  • End If
  • If Asc(Mid$(fin$, 2, 1)) > 57 Or Asc(Mid$(fin$, 2, 1)) < 48 Then
  • bon% = 1
  • End If
  • If Asc(Mid$(fin$, 1, 1)) > 57 Or Asc(Mid$(fin$, 1, 1)) < 48 Then
  • bon% = 1
  • End If
  • End If
  • If Right$(h$, 2) = "PM" Then
  • If Val(Left$(fin$, 2)) > 11 Then
  • bon% = 1
  • End If
  • Else
  • If Val(Left$(fin$, 2)) > 23 Then
  • bon% = 1
  • End If
  • End If
  • If Val(Right$(fin$, 2)) > 59 Then
  • bon% = 1
  • End If
  • limite = Texte2.Text
  • If limite <> "" Then
  • limite0 = Val(limite)
  • If limite0 > 32767 Then
  • bon% = 1
  • End If
  • For k% = 1 To Len(limite)
  • If Asc(Mid$(limite, k%, 1)) > 57 Or Asc(Mid$(limite, k%, 1)) < 48 Then
  • bon% = 1
  • End If
  • Next k%
  • Else
  • bon% = 1
  • End If
  • If bon% = 0 Then
  • heure_fin$ = Left$(fin$, 2)
  • heure_f = Val(heure_fin$)
  • If Right$(h$, 2) = "PM" Then
  • heure_f = heure_f + 12
  • End If
  • minute_fin$ = Right$(fin$, 2)
  • minute_f = Val(minute_fin$)
  • drapeau = 1
  • Feuille1.Visible = False
  • Else
  • bon% = 0
  • MsgBox "Erreur de saisie"
  • End If
  • End Sub
  • Sub Commande2_Click ()
  • terminer
  • End Sub
  • Sub Form_Load ()
  • Minuterie1.Interval = 4000
  • End Sub
  • Sub Minuterie1_Timer ()
  • If drapeau = 1 Then
  • heure$ = Now
  • heure_courante$ = Hour(heure$)
  • heure_c% = Val(heure_courante$)
  • minute_courante$ = Minute(heure$)
  • minute_c% = Val(minute_courante$)
  • If heure_c% = heure_f Then
  • If minute_c% = minute_f Then
  • drapeau = 0
  • drapeau1 = 1
  • drapeau = 0
  • Feuille2.Show
  • SetWindowPos Feuille2.hWnd, -1, 0, 0, 0, 0, &H50
  • End If
  • End If
  • End If
  • If drapeau1 = 1 Then
  • tempo = tempo + 4
  • If tempo > limite0 + 4 Then
  • Feuille2.Hide
  • Unload Feuille2
  • terminer
  • End If
  • End If
  • End Sub
  • Sub terminer ()
  • Unload Me
  • End Sub
Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
Dim drapeau As Integer, heure_f As Integer, minute_f As Integer, drapeau1 As Integer, tempo As Integer, limite0 As Integer
Dim limite As String

Sub Commande1_Click ()
h$ = Now
bon% = 0
fin$ = Texte1.Text
If Len(fin$) <> 5 Then
bon% = 1
Else
If Asc(Mid$(fin$, 5, 1)) > 57 Or Asc(Mid$(fin$, 5, 1)) < 48 Then
bon% = 1
End If
If Asc(Mid$(fin$, 4, 1)) > 57 Or Asc(Mid$(fin$, 4, 1)) < 48 Then
bon% = 1
End If
If Asc(Mid$(fin$, 2, 1)) > 57 Or Asc(Mid$(fin$, 2, 1)) < 48 Then
bon% = 1
End If
If Asc(Mid$(fin$, 1, 1)) > 57 Or Asc(Mid$(fin$, 1, 1)) < 48 Then
bon% = 1
End If
End If
If Right$(h$, 2) = "PM" Then
If Val(Left$(fin$, 2)) > 11 Then
bon% = 1
End If
Else
If Val(Left$(fin$, 2)) > 23 Then
bon% = 1
End If
End If
If Val(Right$(fin$, 2)) > 59 Then
bon% = 1
End If
limite = Texte2.Text
If limite <> "" Then
limite0 = Val(limite)
If limite0 > 32767 Then
bon% = 1
End If
For k% = 1 To Len(limite)
If Asc(Mid$(limite, k%, 1)) > 57 Or Asc(Mid$(limite, k%, 1)) < 48 Then
bon% = 1
End If
Next k%
Else
bon% = 1
End If
If bon% = 0 Then
heure_fin$ = Left$(fin$, 2)
heure_f = Val(heure_fin$)
If Right$(h$, 2) = "PM" Then
heure_f = heure_f + 12
End If
minute_fin$ = Right$(fin$, 2)
minute_f = Val(minute_fin$)
drapeau = 1
Feuille1.Visible = False
Else
bon% = 0
MsgBox "Erreur de saisie"
End If

End Sub

Sub Commande2_Click ()
terminer
End Sub

Sub Form_Load ()
Minuterie1.Interval = 4000
End Sub

Sub Minuterie1_Timer ()
If drapeau = 1 Then
heure$ = Now
heure_courante$ = Hour(heure$)
heure_c% = Val(heure_courante$)
minute_courante$ = Minute(heure$)
minute_c% = Val(minute_courante$)
If heure_c% = heure_f Then
If minute_c% = minute_f Then
drapeau = 0
drapeau1 = 1
drapeau = 0
Feuille2.Show
SetWindowPos Feuille2.hWnd, -1, 0, 0, 0, 0, &H50
End If
End If
End If
If drapeau1 = 1 Then
tempo = tempo + 4
If tempo > limite0 + 4 Then
Feuille2.Hide
Unload Feuille2
terminer
End If
End If

End Sub

Sub terminer ()
Unload Me
End Sub



 Sources du même auteur

Source avec Zip Source avec une capture CHAT WINSOCK (CLIENT / SERVEUR ) TUTORIEL N°2
Source avec Zip Source avec une capture DES ASTUCES OU UN TUTORIAL POUR LES >>> DÉBUTANTS <<< POUR V...
Source avec Zip GÉNÉRATEUR DE MOTS DE PASSE (8 LETTRES)
Source avec Zip Source avec une capture ENVOI DE MAIL PAR MICROSOFT MAPI CONTROL 6.0
HEURE ET DATE EN VBSCRIPT

 Sources de la même categorie

Source avec Zip Source avec une capture Source .NET (Dotnet) OUVRIR UNE BASE DE DONNÉES DANS PLUSIEURS DATAGRIDVIEW DANS ... par PHILOUVB
Source .NET (Dotnet) CONTROLS PERSONALISÉ TEXTBOX par rodcobalt22
Source avec une capture Source .NET (Dotnet) CREATION DE CONTROLS DYNAMIQUE + DEPLACEMENT ET REDIMENTION ... par tresorsdevie
Source avec Zip Source avec une capture USERCONTROL AVEC PROPERTIES PERSONALISABLE par Polack77
Source avec Zip Source avec une capture BOUTON UP_DOWN par epson1

Commentaires et avis

Commentaire de Renfield le 02/10/2003 18:39:39 administrateur CS

Que ton code est inutilement compliqué !!

Commentaire de NISANDSYSTEMS le 03/10/2003 13:08:19

Pour une fois,je suis d'accord avec Renfield.

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix


HTC Hero

Entre 550€ et 550€

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,655 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales