14-12-12, 08:48 PM
Osama_Ghareeb كتب :كود :
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Dim Arr(ComboBox1.Items.Count - 1) As String
ComboBox1.Items.CopyTo(Arr, 0)
IO.File.WriteAllLines("Data.txt", Arr)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Computer.FileSystem.FileExists("Data.txt") Then
ComboBox1.Items.AddRange(IO.File.ReadAllLines("Data.txt"))
End If
End Sub
بالتوفيق
جزاك الله كل خير أخى
أخى كيف يمكن عند اضافت New Item لو وجد Item فى Combobox يظهر رساله هذا الكلمه موجوده من قبل
