Académique Documents
Professionnel Documents
Culture Documents
Grille
Les fonctions qui s’y appliquent sont :
Changer sa propriété Name : Grille
1) ListBox1.Items.Contains(TextBox1.Text.ToLo
wer) Pour mettre 3 colonnes et 20 lignes dans la grille
2) ListBox1.Items.Add(TextBox1.Text)
3) ListBox1.Items.Count Grille.RowCount= 20
4) If (ListBox1.SelectedIndex = -1) Then
MessageBox.Show("Erreur : Veuillez sélectionner un Grille.ColumnCount= 3
module ")
5) ListBox1.Items.Remove(ListBox1.SelectedItem Grille.Items(i ,j).Value=12
)
6) ListBox1.Items.Clear() On declare la variable ligne dans la forme et nn
7) Private Function
vertifier_module_existe(ByVal modl As String) pas dans le bouton!!!
As Boolean
ligne += 1
Dim i As Integer
If ListBox1.Items.Count = 0 Then Grille.Rows.Clear() ' effacer les lignes et
Return False leurs contenus
Else Grille.RowCount = 50
For i = 0 To ListBox1.Items.Count - 1
If ListBox1.Items(i).ToString.ToLower =
modl.ToLower Then
Return True Fichier
End If
LOF (NuméroFichier) :
Bloquer une zone de texte aux
seuls valeurs numériques 'Lenght Of File', il retourne la longueur
' L'événement keyPress : bloque les caractères du fichier en octets.
non numériques
FileClose(NuméroFichier) :
' il autorise les nombre et aussi le
caractère de suppression : code ascii 8 Permet de fermer le fichier
' et également le . code acii 46
' rq : la virgule , a pour code ascii 'Boutton save
44 Dim reponse As String
If IsNumeric(e.KeyChar) Or With SaveFileDialog1
Asc(e.KeyChar) = 8 Or Asc(e.KeyChar) = 46 Then .Title = "Sauvegarder"
e.Handled = False .InitialDirectory = "f:\"
Else .Filter = "Fichiers txt|*.txt"
e.Handled = True .ShowDialog()
End If reponse = .FileName
End With If OpenFileDialog1.FileName <> "" Then
'reponse = InputBox("Veuillez donner le Try
nom du fichier", "Nom save") FileOpen(1,
FileOpen(1, reponse, OpenMode.Output) OpenFileDialog1.FileName, OpenMode.Input)
PrintLine(1, TextBox1.Text) ' ecrit le Do Until EOF(1)
contenu du texte box dans le fichier LineOfText = LineInput(1)
TextBox1.Clear() AllText = AllText &
FileClose(1) LineOfText & vbCrLf
Loop
'boutton ouvrir
Dim rep As String TextBox1.Text = AllText
Dim ligne As String Catch ex As Exception
With OpenFileDialog1 MessageBox.Show("Error opening
.Title = "Ouvrir" file. It might be too big")
.InitialDirectory = "f:\" End Try
.Filter = "Fichiers txt|*.txt " End If
.ShowDialog() FileClose(1)
rep = .FileName End Sub
End With
Next
If ligne = 0 Then
MessageBox.Show("Pas de
participants avec cette catégorie")
End If
Combobox
indice = ComboBox1.SelectedItem
comboBox1.text=""
Tableau
Dim T() as integer
c = TextBox2.Text.Substring(i, 1):
renvoie un caractère de la chaine
TextBox2.Text à partir de l’indice i
taille = TextBox1.Text.Length
c = Chr(Asc(c) - 3)