15-08-19, 11:47 PM
(15-08-19, 11:36 PM)mohamedahmed1 كتب : اخي هل قصدك انك تريد عرض ما داخل ملف ال Text في الليست بوكس ؟اخي انا اريد ان اضع مسار الملف ويتم جلب ما بداخله داخل الليست بوكس
اذا كان هذا قصدك تفضل الكود
كود :
On Error Resume Next
Dim openfile As New OpenFileDialog
ListBox1.Items.Clear()
openfile.Title = "Text |*.txt"
openfile.ShowDialog()
Dim txtline() As String = IO.File.ReadAllLines(openfile.FileName)
ListBox1.Items.AddRange(txtline)
