1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
| Imports System.Reflection
Imports System.Threading
Module Module_Formulaire_Chargement
'Module de mise en forme de la page d'accueil
''' <summary>
''' Met en forme le formulaire d'accueil
''' </summary>
''' <param name="maForme"></param>
Sub Formulaire_Chargement(ByVal maForme As Form)
#Region "Déclare les élements"
'Ajoute un panel
Dim Panel_Formulaire_Chargement As New Panel 'Initie un nouveau panel pour le formulaire de chargement
With Panel_Formulaire_Chargement 'Paramètre le Panel
.Name = "Panel_Formulaire_Chargement" 'Nome le panel
.Dock = DockStyle.Fill 'Occupe toute la place
End With
'Ajoute un Tableau
Dim TLP_Formulaire_Chargement As New TableLayoutPanel 'Initie un nouveau panel pour le formulaire de chargement
With TLP_Formulaire_Chargement 'Paramètre le Panel
.Name = "TLP_Formulaire_Chargement" 'Nome le panel
.ColumnCount = 2 'Insert colonne
.RowCount = 3 'Insert lignes
.Dock = DockStyle.Fill 'Prise de la plae
'.Location = New Point((maForme.ClientSize.Width - TLP_Formulaire_Chargement.Width) \ 2, (maForme.ClientSize.Height - TLP_Formulaire_Chargement.Height) \ 2) 'Place le formulaire au centre
.MinimumSize = New Size(650, 200) 'Taille minimum
'Déini les styles de colonnes
.ColumnStyles.Add(New ColumnStyle(SizeType.Percent, 100)) ' % de la largeur totale
.ColumnStyles.Add(New ColumnStyle(SizeType.Percent, 100)) ' % de la largeur totale
'Défini les styles de lignes
.RowStyles.Add(New RowStyle(SizeType.Percent, 100)) ' % de la hauteur totale
.RowStyles.Add(New RowStyle(SizeType.Absolute, 200)) ' Hauteur en absolue
.RowStyles.Add(New RowStyle(SizeType.Percent, 100)) ' % de la hauteur totale
End With
'Ajoute le logo
Dim Logo As New PictureBox
With Logo 'Paramètre le logo
.Image = My.Resources.Logo 'Défini l'image
.SizeMode = PictureBoxSizeMode.Zoom 'Ajustage au contenu
.Dock = DockStyle.Fill 'Prend toute la place
.Size = New Size(350, 200)
.Dock = DockStyle.Right
End With
'Ajout pannel pour cellule Ligne 0 / Colonne 1
Dim Panel_Label_Software As New Panel
With Panel_Label_Software
.Name = "Panel_Label_Software" 'Nom
.Dock = DockStyle.Fill 'Place
End With
'Ajoute le texte d'initialisation
Dim Label_Initialisation As New Label
With Label_Initialisation
.Name = "Label_Initialisation" 'Nom
.Text = "Software initialization GxTIS"
.Font = Police_Titre 'Police
.Dock = DockStyle.Bottom 'Collé à droite
.AutoSize = True 'Ajustage automatique
End With
'Ajoute la version
Dim Label_Version As New Label
With Label_Version
.Name = "Label_Version" 'Nom
.Text = "Version " & Assembly.GetExecutingAssembly().GetName().Version.ToString
.Font = Police_Corp 'Police
.Dock = DockStyle.Bottom 'Collé à droite
.AutoSize = True 'Ajustage automatique
End With
'Ajoute d'espace
Dim Label_Espace As New Label
With Label_Espace
.Name = "Label_Espace" 'Nom
.Font = Police_Corp 'Police
.Dock = DockStyle.Bottom 'Collé à droite
.AutoSize = True 'Ajustage automatique
End With
'Ajoute le reférence by "TIS"
Dim Label_ByTIS As New Label
With Label_ByTIS
.Name = "Label_ByTIS" 'Nom
.Text = "By TIS"
.Font = Police_Corp 'Police
.Dock = DockStyle.Bottom 'Collé à droite
.AutoSize = True 'Ajustage automatique
End With
'Ajoute la référence "By yok"
Dim Label_Byyok As New Label
With Label_Byyok
.Name = "Label_Byyok" 'Nom
.Text = "By yok" 'Texte
.Font = Police_stylisé 'Police
.Dock = DockStyle.Bottom 'Collé à droite
.AutoSize = True 'Ajustage automatique
End With
#End Region
#Region "Ajoute les élements"
Panel_Label_Software.Controls.Add(Label_Initialisation) 'Ajout la référence
Panel_Label_Software.Controls.Add(Label_Version) 'Ajout la référence
Panel_Label_Software.Controls.Add(Label_Espace) 'Ajout la référence
Panel_Label_Software.Controls.Add(Label_ByTIS) 'Ajout la référence
Panel_Label_Software.Controls.Add(Label_Byyok) 'Ajout la référence
'Ajout des éléments dans le tableau
TLP_Formulaire_Chargement.Controls.Add(Logo, 0, 1) 'Ajout le picture box en ligne 0 et colonne 0
TLP_Formulaire_Chargement.Controls.Add(Panel_Label_Software, 1, 1) 'Ajout la référence en ligne 0 et colonne 1
Panel_Formulaire_Chargement.Controls.Add(TLP_Formulaire_Chargement) 'Ahoute le Tableau
maForme.Controls.Add(Panel_Formulaire_Chargement) 'Ajoute le panel à la forme
#End Region
#Region "Mise en forme Label_Initialisation"
Dim Tache_Modification_Variable_Label_ByTIS As New Thread(Sub() Variation_Label_Initialisation(Label_Initialisation)) With {.IsBackground = True} 'Déclare le thread
Tache_Modification_Variable_Label_ByTIS.Start() 'Lance l'action
#End Region
End Sub
''' <summary>
''' Fonction de variation dun label by TIS
''' </summary>
''' <param name="Label_Initialisation">Reference au label a faire varier</param>
Sub Variation_Label_Initialisation(ByVal Label_Initialisation As Label)
Dim Label_Base As String = Label_Initialisation.Text 'Défini le texte de base
While Label_Initialisation IsNot Nothing 'Boucle infinie
If Verification_Existance_Control(Label_Initialisation) Then 'Si le label existe
Label_Initialisation.BeginInvoke(New Action(Sub() Label_Initialisation.Text = Label_Base)) 'Remet à 0
End If
Thread.Sleep(1000) 'Pause de 1 seconde
For i = 0 To 2 'Ajoute trois fois les points
If Verification_Existance_Control(Label_Initialisation) Then 'Si le label existe
Label_Initialisation.BeginInvoke(New Action(Sub() Label_Initialisation.Text &= ".")) 'Ajout du point
Thread.Sleep(1000) 'Pause de 1 seconde
End If
Next
End While
End Sub
End Module |
Partager