Accueil > > > CALCUL HEURE DE NUIT
CALCUL HEURE DE NUIT
Information sur la source
Description
cette source traite du calcul d heures de nuit elle n est pas encore fini mais peut servir a un débutant je reste a l écoute des experts pour avoir des conseilles pour enfin finir ma source tous reproche ou info est bonne a prendre
Source
- Private Sub apercu_Click()
- Printer.TrackDefault = True
- Printer.ScaleMode = 6
- Printer.Orientation = 1
- Printer.PaperSize = 9
- Printer.PrintQuality = -4
- Printer.ColorMode = 1
- Printer.FontSize = 20 'taille de la police
- DecalX = 20 - (Printer.Width - Printer.ScaleWidth) / 2
- DecalY = 15 - (Printer.Height - Printer.ScaleHeight) / 2
- Printer.PaintPicture MSFlexGrid1.Picture, 30, 60
-
- Printer.EndDoc
-
- End Sub
-
- Private Sub Command1_Click()
- Dim i As Integer
- i = Row + 2
- MSFlexGrid1.AddItem Calendar1, 2
- MSFlexGrid1.TextMatrix(i, 1) = TxtHeureDebut.Text & " h " & TxtMinuteDebut.Text
- MSFlexGrid1.TextMatrix(i, 2) = TxtHeureFin.Text & " h " & TxtMinuteFin.Text
- MSFlexGrid1.TextMatrix(i, 3) = TxtHeureResultat.Text & " h " & TxtMinuteResultat.Text
- MSFlexGrid1.TextMatrix(i, 4) = Txtohsupp.Text & " h " & Txtomsupp.Text
- MSFlexGrid1.TextMatrix(i, 5) = Textheurenuit.Text & " h " & Textminnuit.Text
- On Error Resume Next
- Text5.Text = Text5.Text
- Texthnorm.Text = CSng(TxtHeureResultat.Text) + CSng(Texthnorm.Text)
- Text5.Text = CSng(Text5.Text) + CSng(TxtMinuteResultat.Text)
- Text8.Text = CSng(Textheurenuit.Text) + CSng(Text8.Text)
- Text9.Text = CSng(Textminnuit.Text) + CSng(Text9.Text)
- Text6.Text = CSng(Txtohsupp.Text) + CSng(Text6.Text)
- Text7.Text = CSng(Txtomsupp.Text) + CSng(Text7.Text)
- If Text5.Text > 60 Then Texthnorm.Text = Texthnorm.Text + 1
-
- If Text5.Text > 59 Then Text5.Text = Text5.Text - 60
- If Text7.Text > 60 Then Text6.Text = Text6.Text + 1
-
- If Text7.Text > 59 Then Text7.Text = Text7.Text - 60
- If Text7.Text < 0 Then Text6.Text = Text6.Text - 1
- If Text7.Text < 0 Then Text7.Text = Text7.Text + 60
- If Text6.Text < 0 Then Text6.Text = 0
-
- End Sub
-
- Private Sub Command2_Click()
- CalculMinuteFin = TxtMinuteFin
- CalculHeureFin = TxtHeureFin
-
-
- If TxtMinuteFin < TxtMinuteDebut Then
- CalculMinuteFin = TxtMinuteFin + 60
- End If
-
- If TxtHeureFin < TxtHeureDebut Then
- CalculHeureFin = TxtHeureFin + 24
- End If
-
-
- TxtHeureResultat = CalculHeureFin - TxtHeureDebut
- TxtMinuteResultat = CalculMinuteFin - TxtMinuteDebut
- Txtohsupp = TxtHeureResultat - 6
- Txtomsupp = TxtMinuteResultat - 30
-
- Textheurenuit = H2 - TxtHeureDebut
-
- Textminnuit = M2 - TxtMinuteDebut
-
- End Sub
-
- Private Sub Command3_Click()
- Dim f As Integer
- f = FreeFile
- Open "apercu.txt" For Output As #f
- Print #f, Texthnorm.Text
- Close #f
- Dim a As Integer
- a = FreeFile
- Open "1.txt" For Output As #a
- Print #a, Text5.Text
- Close #a
- Dim b As Integer
- b = FreeFile
- Open "2.txt" For Output As #b
- Print #b, Text6.Text
- Close #b
- Dim c As Integer
- c = FreeFile
- Open "3.txt" For Output As #c
- Print #c, Text7.Text
- Close #c
- Dim d As Integer
- d = FreeFile
- Open "4.txt" For Output As #d
- Print #d, Text8.Text
- Close #d
- Dim e As Integer
- e = FreeFile
- Open "5.txt" For Output As #e
- Print #e, Text9.Text
- Close #e
- Dim file_name As String
- Dim fnum As Integer
- Dim max_row As Integer
- Dim max_col As Integer
- Dim R As Integer
- Dim yy As Integer
-
- file_name = App.Path
- If Right$(file_name, 1) <> "\" Then file_name = file_name & "\"
- file_name = file_name & "FlexGrid1.dat"
-
- fnum = FreeFile
- Open file_name For Output As fnum
-
- ' Save the maximum row and column.
- max_row = MSFlexGrid1.Rows - 1
- max_col = MSFlexGrid1.Cols - 1
- Write #fnum, max_row, max_col
-
- For R = 0 To max_row
- For yy = 0 To max_col
- Write #fnum, MSFlexGrid1.TextMatrix(R, yy);
- Next yy
- Write #fnum,
- Next R
-
- Close fnum
- End Sub
- Private Sub Command4_Click()
- MSFlexGrid1.Clear
- MSFlexGrid1.Rows = 1
- MSFlexGrid1.Row = 0
- MSFlexGrid1.Col = 0
- End Sub
-
-
- Private Sub Command7_Click()
- Texthnorm.Text = "00"
- Text5.Text = "00"
- Text6.Text = "00"
- Text7.Text = "00"
- Text8.Text = "00"
- Text9.Text = "00"
- TxtHeureDebut = "00"
- TxtMinuteDebut = "00"
- TxtHeureFin = "00"
- TxtMinuteFin = "00"
- End Sub
-
- Private Sub Form_Load()
-
-
- Open App.Path & "\apercu.TXT" For Input As #1
- Texthnorm.Text = Input(LOF(1), #1)
- Close #1
- Open App.Path & "\1.txt" For Input As #1
- Text5.Text = Input(LOF(1), #1)
- Close #1
- Open App.Path & "\2.txt" For Input As #1
- Text6.Text = Input(LOF(1), #1)
- Close #1
- Open App.Path & "\3.txt" For Input As #1
- Text7.Text = Input(LOF(1), #1)
- Close #1
- Open App.Path & "\4.txt" For Input As #1
- Text8.Text = Input(LOF(1), #1)
- Close #1
- Open App.Path & "\5.txt" For Input As #1
- Text9.Text = Input(LOF(1), #1)
- Close #1
-
- With MSFlexGrid1
- .MergeCells = 1
- MSFlexGrid1.MergeRow(1) = True
- .Rows = 2
- .Cols = 6
- .MergeCells = 0
- .MergeRow(0) = True
- .ColWidth(0) = 1100
- .ColWidth(1) = 1400
- .ColWidth(2) = 1400
- .ColWidth(3) = 1400
- .ColWidth(4) = 1400
- .ColWidth(5) = 1400
- .TabStop = False
- 'Ajouter filds
-
-
- .TextMatrix(0, 0) = "date "
- .TextMatrix(0, 1) = "heure embauche "
- .TextMatrix(0, 2) = "fin de service "
- .TextMatrix(0, 3) = "total jour "
- .TextMatrix(0, 4) = "heure supp "
- .TextMatrix(0, 5) = "heure nuit "
-
- End With
- Dim file_name As String
- Dim fnum As Integer
- Dim max_row As Integer
- Dim max_col As Integer
- Dim R As Integer
- Dim c As Integer
- Dim txt As String
- Dim max_len As Single
- Dim new_len As Single
-
- file_name = App.Path
- If Right$(file_name, 1) <> "\" Then file_name = file_name & "\"
- file_name = file_name & "FlexGrid1.dat"
-
- fnum = FreeFile
- Open file_name For Input As fnum
-
- ' Hide the control until it's loaded.
- MSFlexGrid1.Visible = False
- DoEvents
-
- ' Get the maximum row and column.
- Input #fnum, max_row, max_col
-
- MSFlexGrid1.FixedCols = 0
- MSFlexGrid1.Cols = max_col + 1
- MSFlexGrid1.FixedRows = 1
- MSFlexGrid1.Rows = max_row + 1
-
- ' Load the cell entries.
- For R = 0 To max_row
- For c = 0 To max_col
- Input #fnum, txt
- MSFlexGrid1.TextMatrix(R, c) = txt
- Next c
-
- ' Read the last blank entry.
- Input #fnum, txt
- Next R
-
- Close #fnum
-
-
- ' Size the columns.
- Font.Name = MSFlexGrid1.Font.Name
- Font.Size = MSFlexGrid1.Font.Size
- For c = 0 To max_col
- max_len = 0
- For R = 0 To max_row
- new_len = TextWidth(MSFlexGrid1.TextMatrix(R, c))
- If max_len < new_len Then max_len = new_len
- Next R
- MSFlexGrid1.ColWidth(c) = max_len + 240
- MSFlexGrid1.ColAlignment(c) = flexAlignLeftCenter
- Next c
-
- ' Display the control.
- MSFlexGrid1.Visible = True
- End Sub
-
-
-
-
-
-
-
-
-
-
-
Private Sub apercu_Click()
Printer.TrackDefault = True
Printer.ScaleMode = 6
Printer.Orientation = 1
Printer.PaperSize = 9
Printer.PrintQuality = -4
Printer.ColorMode = 1
Printer.FontSize = 20 'taille de la police
DecalX = 20 - (Printer.Width - Printer.ScaleWidth) / 2
DecalY = 15 - (Printer.Height - Printer.ScaleHeight) / 2
Printer.PaintPicture MSFlexGrid1.Picture, 30, 60
Printer.EndDoc
End Sub
Private Sub Command1_Click()
Dim i As Integer
i = Row + 2
MSFlexGrid1.AddItem Calendar1, 2
MSFlexGrid1.TextMatrix(i, 1) = TxtHeureDebut.Text & " h " & TxtMinuteDebut.Text
MSFlexGrid1.TextMatrix(i, 2) = TxtHeureFin.Text & " h " & TxtMinuteFin.Text
MSFlexGrid1.TextMatrix(i, 3) = TxtHeureResultat.Text & " h " & TxtMinuteResultat.Text
MSFlexGrid1.TextMatrix(i, 4) = Txtohsupp.Text & " h " & Txtomsupp.Text
MSFlexGrid1.TextMatrix(i, 5) = Textheurenuit.Text & " h " & Textminnuit.Text
On Error Resume Next
Text5.Text = Text5.Text
Texthnorm.Text = CSng(TxtHeureResultat.Text) + CSng(Texthnorm.Text)
Text5.Text = CSng(Text5.Text) + CSng(TxtMinuteResultat.Text)
Text8.Text = CSng(Textheurenuit.Text) + CSng(Text8.Text)
Text9.Text = CSng(Textminnuit.Text) + CSng(Text9.Text)
Text6.Text = CSng(Txtohsupp.Text) + CSng(Text6.Text)
Text7.Text = CSng(Txtomsupp.Text) + CSng(Text7.Text)
If Text5.Text > 60 Then Texthnorm.Text = Texthnorm.Text + 1
If Text5.Text > 59 Then Text5.Text = Text5.Text - 60
If Text7.Text > 60 Then Text6.Text = Text6.Text + 1
If Text7.Text > 59 Then Text7.Text = Text7.Text - 60
If Text7.Text < 0 Then Text6.Text = Text6.Text - 1
If Text7.Text < 0 Then Text7.Text = Text7.Text + 60
If Text6.Text < 0 Then Text6.Text = 0
End Sub
Private Sub Command2_Click()
CalculMinuteFin = TxtMinuteFin
CalculHeureFin = TxtHeureFin
If TxtMinuteFin < TxtMinuteDebut Then
CalculMinuteFin = TxtMinuteFin + 60
End If
If TxtHeureFin < TxtHeureDebut Then
CalculHeureFin = TxtHeureFin + 24
End If
TxtHeureResultat = CalculHeureFin - TxtHeureDebut
TxtMinuteResultat = CalculMinuteFin - TxtMinuteDebut
Txtohsupp = TxtHeureResultat - 6
Txtomsupp = TxtMinuteResultat - 30
Textheurenuit = H2 - TxtHeureDebut
Textminnuit = M2 - TxtMinuteDebut
End Sub
Private Sub Command3_Click()
Dim f As Integer
f = FreeFile
Open "apercu.txt" For Output As #f
Print #f, Texthnorm.Text
Close #f
Dim a As Integer
a = FreeFile
Open "1.txt" For Output As #a
Print #a, Text5.Text
Close #a
Dim b As Integer
b = FreeFile
Open "2.txt" For Output As #b
Print #b, Text6.Text
Close #b
Dim c As Integer
c = FreeFile
Open "3.txt" For Output As #c
Print #c, Text7.Text
Close #c
Dim d As Integer
d = FreeFile
Open "4.txt" For Output As #d
Print #d, Text8.Text
Close #d
Dim e As Integer
e = FreeFile
Open "5.txt" For Output As #e
Print #e, Text9.Text
Close #e
Dim file_name As String
Dim fnum As Integer
Dim max_row As Integer
Dim max_col As Integer
Dim R As Integer
Dim yy As Integer
file_name = App.Path
If Right$(file_name, 1) <> "\" Then file_name = file_name & "\"
file_name = file_name & "FlexGrid1.dat"
fnum = FreeFile
Open file_name For Output As fnum
' Save the maximum row and column.
max_row = MSFlexGrid1.Rows - 1
max_col = MSFlexGrid1.Cols - 1
Write #fnum, max_row, max_col
For R = 0 To max_row
For yy = 0 To max_col
Write #fnum, MSFlexGrid1.TextMatrix(R, yy);
Next yy
Write #fnum,
Next R
Close fnum
End Sub
Private Sub Command4_Click()
MSFlexGrid1.Clear
MSFlexGrid1.Rows = 1
MSFlexGrid1.Row = 0
MSFlexGrid1.Col = 0
End Sub
Private Sub Command7_Click()
Texthnorm.Text = "00"
Text5.Text = "00"
Text6.Text = "00"
Text7.Text = "00"
Text8.Text = "00"
Text9.Text = "00"
TxtHeureDebut = "00"
TxtMinuteDebut = "00"
TxtHeureFin = "00"
TxtMinuteFin = "00"
End Sub
Private Sub Form_Load()
Open App.Path & "\apercu.TXT" For Input As #1
Texthnorm.Text = Input(LOF(1), #1)
Close #1
Open App.Path & "\1.txt" For Input As #1
Text5.Text = Input(LOF(1), #1)
Close #1
Open App.Path & "\2.txt" For Input As #1
Text6.Text = Input(LOF(1), #1)
Close #1
Open App.Path & "\3.txt" For Input As #1
Text7.Text = Input(LOF(1), #1)
Close #1
Open App.Path & "\4.txt" For Input As #1
Text8.Text = Input(LOF(1), #1)
Close #1
Open App.Path & "\5.txt" For Input As #1
Text9.Text = Input(LOF(1), #1)
Close #1
With MSFlexGrid1
.MergeCells = 1
MSFlexGrid1.MergeRow(1) = True
.Rows = 2
.Cols = 6
.MergeCells = 0
.MergeRow(0) = True
.ColWidth(0) = 1100
.ColWidth(1) = 1400
.ColWidth(2) = 1400
.ColWidth(3) = 1400
.ColWidth(4) = 1400
.ColWidth(5) = 1400
.TabStop = False
'Ajouter filds
.TextMatrix(0, 0) = "date "
.TextMatrix(0, 1) = "heure embauche "
.TextMatrix(0, 2) = "fin de service "
.TextMatrix(0, 3) = "total jour "
.TextMatrix(0, 4) = "heure supp "
.TextMatrix(0, 5) = "heure nuit "
End With
Dim file_name As String
Dim fnum As Integer
Dim max_row As Integer
Dim max_col As Integer
Dim R As Integer
Dim c As Integer
Dim txt As String
Dim max_len As Single
Dim new_len As Single
file_name = App.Path
If Right$(file_name, 1) <> "\" Then file_name = file_name & "\"
file_name = file_name & "FlexGrid1.dat"
fnum = FreeFile
Open file_name For Input As fnum
' Hide the control until it's loaded.
MSFlexGrid1.Visible = False
DoEvents
' Get the maximum row and column.
Input #fnum, max_row, max_col
MSFlexGrid1.FixedCols = 0
MSFlexGrid1.Cols = max_col + 1
MSFlexGrid1.FixedRows = 1
MSFlexGrid1.Rows = max_row + 1
' Load the cell entries.
For R = 0 To max_row
For c = 0 To max_col
Input #fnum, txt
MSFlexGrid1.TextMatrix(R, c) = txt
Next c
' Read the last blank entry.
Input #fnum, txt
Next R
Close #fnum
' Size the columns.
Font.Name = MSFlexGrid1.Font.Name
Font.Size = MSFlexGrid1.Font.Size
For c = 0 To max_col
max_len = 0
For R = 0 To max_row
new_len = TextWidth(MSFlexGrid1.TextMatrix(R, c))
If max_len < new_len Then max_len = new_len
Next R
MSFlexGrid1.ColWidth(c) = max_len + 240
MSFlexGrid1.ColAlignment(c) = flexAlignLeftCenter
Next c
' Display the control.
MSFlexGrid1.Visible = True
End Sub
Historique
- 27 janvier 2009 13:37:01 :
- excuse pour les fautes d ortographes
- 01 février 2009 10:09:45 :
- j ai modifier la commande 1 pour pouvoir faire un total heure normal
- 01 février 2009 10:21:14 :
- ajout d une capture
- 15 février 2009 08:02:38 :
- UN PEUT DE MODIFICATION DU CODE SUITE AUX CONSEIL QUE L ON M A DONNE
- 15 février 2009 08:09:56 :
- BESOIN AIDE AVEC LA SAUVEGARDE DU MSFLEXGRID
- 15 avril 2009 19:17:56 :
- j ais juste refait le zip
- 19 avril 2009 10:52:42 :
- J AI MODIFIER LA SAUVEGARDE DU FLEXGRID ET REFAIT LE ZIP
N OUBLIER PAS DE METTRE UNE NOTE OU UN COMMENTAIRE
MERCI
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
flexgrid ... [ par jfd ]
salut,est-il possible d'éditer une cellule d'un flexgrid en execution ??merci d'avance
Eléments d'un fichier texte dans un Flexgrid [ par florian ]
Je cherche à placer des éléments d'un fichier texte dans un objet Flexgrid mais j'ai quelques difficultés à y arriverMerci pour toutes informationsSal
2048 lignes dans un flexgrid [ par florian ]
J'extrais des données d'un fichier textepour les mettre dans une MSHflexgrid mais je n'arrive pas à afficher l'intégralité de celui-ci.la flexgrid s'a
Transformer un flexGrid en Image [ par ARCHAON ]
J'aimerai savoir comment faire pour transformer un MS FlexGrid en image sous VB ... je sais je suis un peu barje mais je n'ai pas le choix ;-) .. c'es
Imprimer un MS FlexGrid [ par apkwa ]
J'essaye d'imprimer un MSFlexGrid qui n'apparaît pas complètement sur l'écran.J'ai essayéPrinter.PaintPicture MSFlexGrid1.PicturePrinter.EndDocmais ça
Problème de license avec le controle FlexGrid sous VBA [ par yakcutter ]
J'utilise VBA et lorsque je veux créer un contrôle Microsoft FlexGrid (et même certains autres) VBA me lance " Le contrôle n'a pas été créé parce qu'i
aide sur flexgrid [ par math ]
Bonjour,je dois transferer le resultat d'une requete toute bete de type"select * from xxx where chps='zzzz'" sur un flexgrid.Mais je ne sais pas comme
flexgrid et survol de souris [ par patrice ]
bonjour, j'aimerais faire apparaitre au survol de la sourissur le flexgrid lavaleur de la cellule survolee dans une bulle generee avec la propriete to
Désespéremment.....Datagrid ou flexgrid dans une feuille parent/enfant [ par coco ]
J'en suis à ma premiere application ADO et je suis désespéré!!!J'ai une feuille parent/enfant dans laquelle le datagrid est "l'enfant".Ex. Étudiants (
Fusion de cellules dans un MS Flexgrid [ par Eric ]
Bonjour,est-ce que quelqu'un sait s'il est possible de fusionner des cellules à la fois en lignes et en colonnes ?Visiblement non car les cellules son
|
Derniers Blogs
[WP7] UTILISER UN WRAPPANEL DANS UNE APPLICATION WINDOWS PHONE 7[WP7] UTILISER UN WRAPPANEL DANS UNE APPLICATION WINDOWS PHONE 7 par Audrey
Lors de la réalisation de ma 2ème application Windows Phone 7, j'ai souhaité utiliser un WrapPanel pour afficher plusieurs photos. Mais le contrôle WrapPanel ne fait pas parti de la liste des contrôles inclus dans le SDK de la version Beta des outils pour...
Cliquez pour lire la suite de l'article par Audrey [WP7] BESOIN D'AVOIR DES DONNéES EN CACHE[WP7] BESOIN D'AVOIR DES DONNéES EN CACHE par Nicolas
Les développeurs ASP.NET ont l'habitude de mettre des données en cache pour éviter de requêter a chaque fois la base de données. Et il est toujours utilie de penser que vos utilisateurs mobiles n'ont pas troujours une super connexion 3G/WIFI et un for...
Cliquez pour lire la suite de l'article par Nicolas [TFS] COMMENT FORCER LA SAISIE D'UN AREA OU ITERATION[TFS] COMMENT FORCER LA SAISIE D'UN AREA OU ITERATION par cyril
Lorsque l'on créé un Work Item dans TFS, il est possible de le classer dans un "area" et dans une "iteration". Dans la plupart des types de projet, un "area" correspond à une catégorie, une "iteration" à un numéro de version. Il est possible de cré...
Cliquez pour lire la suite de l'article par cyril SQL : FONCTIONS D'AGRéGATION MIN/MAX ET VALEURS NULLSQL : FONCTIONS D'AGRéGATION MIN/MAX ET VALEURS NULL par coq
Les fonctions d'agrégation comme MIN et MAX ignorent les valeurs NULL présentes dans le jeu de données sur lequel porte leur calcul, d'où le fameux message d'avertissement : Warning: Null value is eliminated by an aggregate or other SET operation...
Cliquez pour lire la suite de l'article par coq VOTEZ POUR WARNYGOVOTEZ POUR WARNYGO par Nicolas
La vidéo du projet Warnygo est disponible sur facebook et attend vos votes ! Pour rappel: Warnygo est une application Windows Phone 7 qui permet d'alerter tous utilisateurs inscrits qui se trouve dans la zone où se passe l'...
Cliquez pour lire la suite de l'article par Nicolas
Logiciels
sDEVIS-FACTURES vlPRO (3.8.0)SDEVIS-FACTURES VLPRO (3.8.0)sDEVIS-FACTURES vlPRO a été mis au point pour permettre besoins des particuliers, créateurs, entr... Cliquez pour télécharger sDEVIS-FACTURES vlPRO LettresFaciles (5.6.0)LETTRESFACILES (5.6.0)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles MyPlanning 2010 (5.6.0)MYPLANNING 2010 (5.6.0)MyPlanning 2010 permet de créer des plannings sous la représentation de diagrammes. Plannings pré... Cliquez pour télécharger MyPlanning 2010 Emicsoft Mac DVD en iPad Convertisseur (3.1.16)EMICSOFT MAC DVD EN IPAD CONVERTISSEUR (3.1.16)Emicsoft Mac DVD en iPad Convertisseur, logiciel professionnel de convertir les fichiers DVD en i... Cliquez pour télécharger Emicsoft Mac DVD en iPad Convertisseur Emicsoft ipad ménager pour mac (3.1.08)EMICSOFT IPAD MéNAGER POUR MAC (3.1.08)Emicsoft ipad ménager pour mac est spécialement conçu pour les utilisateurs Mac pour copier des f... Cliquez pour télécharger Emicsoft ipad ménager pour mac
|