Option Strict On Public Class Form1 Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing ' Sauver la liste ListBox1.Items.Clear() For Each ctrl As Control In Me.Controls If TypeOf ctrl Is TextBox Then 'si c'est une TextBox ListBox1.Items.Add(ctrl.Text) End If Next My.Settings.liste = New Specialized.StringCollection() For Each item In ListBox1.Items My.Settings.liste.Add(item.ToString()) Next End Sub Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load ListBox1.Visible = False 'restaurer la liste If Not My.Settings.liste Is Nothing Then For Each item In My.Settings.liste ListBox1.Items.Add(item) Next End If For i As Int32 = 0 To ListBox1.Items.Count - 1 For Each ctrl As Control In Me.Controls If TypeOf ctrl Is TextBox Then ctrl.TabIndex = i ctrl.Text = ListBox1.Items(i).ToString i = i + 1 End If Next Next End Sub End Class
Modifié par ucfoutu le 7/07/2015 à 18:56
Essaye de faire attention la prochaine fois
Salut, Whism (ma modif pour garder mon foie tranquille).
En dépit de l'alcool qui y passe ... (LOL)..
7 juil. 2015 à 21:50