30-06-14, 09:21 PM
.....
فكرة منقولة
.....
فكرة منقولة
كود :
' تحديد السطر المكرر فقط باستثناء السطر الأصل
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.ListBox1.SelectionMode = SelectionMode.MultiSimple
For i1 = 0 To Me.ListBox1.Items.Count - 2
Dim t1 As String = Regex.Match(Me.ListBox1.Items(i1), "((\d)[0-9-]+\w+)").Value.Trim
For i2 = i1 + 1 To Me.ListBox1.Items.Count - 1
Dim t2 As String = Regex.Match(Me.ListBox1.Items(i2), "((\d)[0-9-]+\w+)").Value.Trim
If t1 = t2 Then
Me.ListBox1.SetSelected(i2, True)
If Not Me.ListBox2.Items.Contains(t2) Then
Me.ListBox2.Items.Add(t2)
End If
End If
Next
Next
End Sub.....



