One way is to create a VFP form for this purpose. Add a property to hold the text of the file you want to display, let's call that property cTextString. Place an editbox on the form and set its ControlSource to thisform.cTextString. Use FILETOSTR to load the value of thisform.cTextString from the file you want to display. For example if you pass the name of the file to the form's Init method as tcFileName then you can do thisform.cTextString = FILETOSTR( tcFileName). Since it's a form you can make both it and the edit box resizeable, too. Does that help?
Another option would be to do a MODIFY FILE <filename>. That would be a slightly simpler solution to the one Rick suggested, although it would not give you so much control over the display.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Mike,
I explained in a previous post that that only gave a quarter size window. The suggested code changes didn't have the desired effect.
Rick's option is grand
I've taken a similar approach in the past to what Rick suggested but instead of using an editbox control I used the Web Browser control (Shell.Explorer.2 control).
The benefit is that you can load different file types without having to make any changes to the form (Word, Excel, Visio, Text, Html, Bitmap, etc)
The downside is that you have add more code to control events and errors and loading some file types will take longer as the control is also loading the automation server. Some file types will also launch the associated program outside of you app as well, but that can be controlled by limited file selection.
Have to say that an editbox is a simpler solution and many times simpler is better but take a few minutes to play with the browser control and see if you like it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.