Load Microsoft Visual Basic, then select Standard EXE Project if VB5/6, click on the option then click Open.
A Blank Form named Form1 should then appear Then from the Visual Basic Components Menu Select the Text Box Control
Draw a Text Box on the Form Then goto the Properties box and change MultiLine to True and ScrollBar to 2 - Vertical then from the Visual Basic Components Menu Select the Command Button Control
Draw Three Command Buttons on the Form
Change the Caption of Command3 to Quit using the Properties
Change the Caption of Command2 to Save and the Caption of Command1 to Load, using the Properties for each Button
Double Click on the Button Labeled Load (Command1) and type in the Command1_Click() Sub:
Code:
Dim strName As String, strFile As String, strTemp As String On Error GoTo ErrHandler
strName = InputBox("Filename:")
Open strName For Input As #1
strFile = ""
Do Until EOF(1)
Line Input #1, strTemp
strFile = strFile & strTemp & vbCrLf
Loop
Text1.Text = strFile
Close #1
ErrHandler: Double Click on the Button Labeled Save (Command2) and type in the Command2_Click() Sub:
Code:
Dim strName As String On Error GoTo ErrHandler
strName = InputBox("Filename:")
Open strName For Output As #1
Print #1, Text1.Text
Close #1
ErrHandler: Double Click on the Button Labeled Quit (Command3) and type in the Command3_Click() Sub:
Save the Project (as for example prjTextEditor)into a vacant folder as you have finished the application. Click on Start / Run or Press F5
Now Click on Load and an Input Box will appear, type a location of a file
Click Ok and the document should be displayed in the Text Box
You can Save a txt (Text) File by clicking on Save and enter a filename the contents of the Text Box will be saved to that File so that you can Open (Load) your old File To Quit the Application Click on Quit.
by {nasadaws}
And {nasadaws} friend called dan
and gaminggutter for being there when i felt i needed to post this