Accueil > > > UN CONTRÔLE HORLOGE BASIQUE
UN CONTRÔLE HORLOGE BASIQUE
Information sur la source
Description
Puisque je n'ai pas trouvé de Contrôle ActiveX pour l'heure (comme "Microsoft Calendar Control" pour la date), voici un ocx pour l'heure. Personnalisez le selon vos besoins et vos préférences. Il n'y a pas beaucoup de propriétés (Hour et Minute) car c'est mon premier OCX.
Source
'----------------- Contrôles :
2 textbox : Heure et minute (TxtHeure et txtMinute)
4 command : HeurePlus, HeureMoins, MinutePlus, MinuteMoins
'----------------- Code :
Option Explicit
Private Sub HeureMoins_Click()
With TxtHeure
If .Text = "" Then
.Text = "0"
End If
If .Text = "0" Then
.Text = "23"
Else
.Text = .Text - 1
End If
End With
End Sub
Private Sub HeurePlus_Click()
With TxtHeure
If .Text = "" Then
.Text = "0"
End If
If .Text = "23" Then
.Text = "0"
Else
.Text = .Text + 1
End If
End With
End Sub
Private Sub MinuteMoins_Click()
With TxtMinute
If .Text = "" Then
.Text = "00"
End If
If .Text = "00" Then
.Text = "59"
Else
.Text = .Text - 1
End If
End With
Call Zero
End Sub
Private Sub MinutePlus_Click()
With TxtMinute
If .Text = "" Then
.Text = "00"
End If
If .Text = "59" Then
.Text = "00"
Else
.Text = .Text + 1
End If
End With
Call Zero
End Sub
Private Sub TxtHeure_Change()
Call VerifierHeure
End Sub
Private Sub TxtMinute_Change()
Call VerifierMinute
End Sub
Private Sub TxtMinute_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Zero
End If
End Sub
Private Sub UserControl_Resize()
UserControl.Width = 3345
UserControl.Height = 1665
End Sub
Public Property Get Hour() As String
Hour = TxtHeure.Text
End Property
Public Property Get Minute() As String
Minute = TxtMinute.Text
End Property
Sub VerifierHeure()
If Not (IsNumeric(TxtHeure.Text)) Then
GoTo fin
End If
If TxtHeure.Text < 0 Then
GoTo fin
End If
If TxtHeure.Text > 23 Then
GoTo fin
End If
Exit Sub
fin:
MsgBox "Valeur incorrecte", vbCritical
TxtHeure.Text = "12"
End Sub
Sub VerifierMinute()
If Not (IsNumeric(TxtMinute.Text)) Then
GoTo fin
End If
If TxtMinute.Text < 0 Then
GoTo fin
End If
If TxtMinute.Text > 59 Then
GoTo fin
End If
Exit Sub
fin:
MsgBox "Valeur incorrecte", vbCritical
TxtMinute.Text = "00"
End Sub
Sub Zero()
If Len(TxtMinute.Text) = 1 Then
TxtMinute.Text = "0" & TxtMinute.Text
End If
End Sub
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
OFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONSOFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONS par junarnoalg
De nombreuses entreprises font le choix de SharePoint Online, service fourni au travers de l'offre de Microsoft Office 365. S'il est vrai que ce choix apporte un grand nombre d'avantages; rapidité de mise en ½uvre, disponibilité, large couvertu...
Cliquez pour lire la suite de l'article par junarnoalg PRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGEPRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGE par richardc
http://www.c2idotnet.com/articles/presentation-des-api-rest-de-windows-azure-lister-les-comptes-de-storage
Désolé pour "toto", mais c2i existait avant blogs.developpeur.org et c'est mon site "officiel" ;-) ...
Cliquez pour lire la suite de l'article par richardc [HTML5] SLIDES ET DéMOS : AUTOUR DU W3C , NOUVEAUX STANDARDS ET WEB MOBILE (LILLE)[HTML5] SLIDES ET DéMOS : AUTOUR DU W3C , NOUVEAUX STANDARDS ET WEB MOBILE (LILLE) par Gio
Très bonne après-midi passée lors cette conférence avec le W3C, organisée par L' Inria sur les nouveaux standards, ce Mardi 14 Février, on sent vraiment que çà bosse au W3C, et l'avenir est très très prometteur pour le HTML5, notamment ...
Cliquez pour lire la suite de l'article par Gio GESTION D'EXCEPTION AVEC LES TASKSGESTION D'EXCEPTION AVEC LES TASKS par richardc
Nous avons vu dans un précédent article comment utiliser Task pour effectuer des opérations dans un autre thread.
Malheureusement, comme tout le monde n'est pas parfait, il se peut que cette exécution se passe mal et qu'une exception se produise.
La...
Cliquez pour lire la suite de l'article par richardc
Forum
RE : VITESSERE : VITESSE par ucfoutu
Cliquez pour lire la suite par ucfoutu
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|