I already used the code as below.
Dim openfile1 = New Microsoft.Win32.OpenFileDialog With {.Filter = "Text (*.Text)|*.txt"}
If (openfile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) Then
For Each line As String In File.ReadAllLines(openfile1.FileName)
ListBox1.Items.Add(line)
Next
End If
This code serves on windows form, when I use in WPF there are no errors but can not display the contents of the notepad on the listbox. there is no other solution
thanks to Magnus
I did not think his mistake on System.Windows.Forms.DialogResult
thank you very much, the code works.