Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor If Button3.Text = "Seleziona tutto" Then Button3.Text = "DeSeleziona tutto" For I = 0 To FileListBox1.Items.Count - 1 FileListBox1.SetSelected(I, True) Next Else Button3.Text = "Seleziona tutto" For I = 0 To FileListBox1.Items.Count - 1 FileListBox1.SetSelected(I, False) Next End If System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default End Sub ' per vedere se il filelistbox e' selezionato For I = 0 To FileListBox1.Items.Count - 1 If FileListBox1.GetSelected(0) = True Then Stringa = FileListBox1.Items(I) If Mid(Stringa, 1, 3) = "CED" Then TextBox6.Text = "CED" TextBox1.Text = Mid(Stringa, 10, 5) ' unita TextBox4.Text = Mid(Stringa, 16, 6) ' matricola Else TextBox6.Text = "ALL" TextBox1.Text = Mid(Stringa, 11, 5) ' unita TextBox4.Text = Mid(Stringa, 17, 6) ' matricola End If End If Next |