Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading and Opening a File - easy question??

Status
Not open for further replies.

BuckyBaby

Technical User
Sep 23, 2000
8
0
0
US
Hello,
I think this is an easy question, but I am new to VB and cannot find the appropriate example to solve my project.

I am making a small "viewer" program that displays a library of .rtf documents. The main form in my program has a tab control with lots of tabs - each tab has a file list box that paths itself to the correct files (tab ABC shows the files that start with a or b or c etc....)What I want to happen is when I click a file in a list box and click the "open" button, a second form appears and the contents of the selected .rtf file is loaded into an rtf control in this new form. I have created this second form with the control and have created the open button, but I don't understand how to make the file (as a variable??) load into the new form's control. I keep thinking this is very similar to those examples of building a graphics viewer, but I can't quite apply it. I was also messing with the LoadFile command, but couldn't understand how to apply it across one form to another .

Thanks for your help
 
add a richtextbox to your form, if you will only be doing
rtf files.

in code when a filename is clicked on set

richedtextbox.filename = "the-name-that-was-clicked"

and there you are
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top