Geoffrey
Geoffrey

Reputation: 5432

Fill a Textbox from a File

I am making a Help-form for my application. A Help-form normally has a ListView on the left and a RichTextbox on the right. When you click on a Help topic in the ListView, the text in the RichTextbox is supposed to change accordingly. The text file is part of the application's resources.

Any help will be much appreciated.

Thanks.

Upvotes: 0

Views: 1542

Answers (2)

Geoffrey
Geoffrey

Reputation: 5432

I got it.

Since the text file is in Resources, I can do this:

Richtextbox1.Text = My.Resources.Textfile

Upvotes: 1

Andrew Scagnelli
Andrew Scagnelli

Reputation: 1604

You need to load the file into memory, and then put it into a string. When the user clicks the string, TextBox.Value (I think that's the proper property) should be set to the string.

If you're excessively lazy (after all, it is a Saturday), check out this link: http://www.freevbcode.com/ShowCode.Asp?ID=466. It has what you're looking for, as long as its VB5/6/VBA. I'm not certain if it will run on VB.net.

Upvotes: 0

Related Questions