Hi All. This is my first post here at VBForums.
VB 2013. I have a listbox populated with .rtf files. When clicking a filename I want that file to show up in my richtextbox.
I had it working in VB6 long time ago, but now I can not get it to work.
Please help. It must be very simple.
Here the listbox is populated with the specific .rtf files, and it work just fine.
ListBox1.DataSource = IO.Directory.GetFiles("C:\MiniTanks\RTF", "*.rtf").Select(Function(file) IO.Path.GetFileName(file)).ToList
Then the hard part, not working.
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
rtb3.LoadFile = ListBox1.SelectedItem.ToString()
Please.
My Best // Gert Persson, Malmö Sweden
VB 2013. I have a listbox populated with .rtf files. When clicking a filename I want that file to show up in my richtextbox.
I had it working in VB6 long time ago, but now I can not get it to work.
Please help. It must be very simple.
Here the listbox is populated with the specific .rtf files, and it work just fine.
ListBox1.DataSource = IO.Directory.GetFiles("C:\MiniTanks\RTF", "*.rtf").Select(Function(file) IO.Path.GetFileName(file)).ToList
Then the hard part, not working.
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
rtb3.LoadFile = ListBox1.SelectedItem.ToString()
Please.
My Best // Gert Persson, Malmö Sweden