Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15151

listbox to richtextbox

$
0
0
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

Viewing all articles
Browse latest Browse all 15151

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>