Hi all,

I'm trying to make super simple essay-writing-helper program, I have created 4 forms (intro,paragraph1,paragraph2,result) and in each form contains a textbox where the essay will be typed in. The first form is for the introduction, and next is the first paragraph and so on. The last form the result form where the whole completed essay is displayed in a textbox of its own. All these textboxes are set to multiline.

The flow is like so: intro form [next] -> paragraph1 form [next] -> paragraph2 form [next] -> result form.

I know how to display all combined inputs on all textboxes on the result form;
[code]
result.Show
result.results.Text = intro.Text & vbCrLf & paragraph1.Text & vbCrLf & paragraph2.Text
[/code]

My question is let's say I'm in a middle of writing, stopped halfway and would like to continue later, can we save all inputs from all textboxes into ONE save file and open it again to be displayed in their respective textbox for future use? Save inputs and load inputs back to their own textboxes?

Thanks.

Sure. Just write each paragraph as a separate line in the save file. Your loop would be

    For Each tbx As TextBox In Me.Controls.OfType(Of TextBox)()
        `output tbx.Text
    Next

with the reverse on form load. You'd need to do some checking such as checkng if the temp save file exists before trying to read it, etc. If you have other non-paragraph textboxes you could put the save/restore textboxes in a container like a panel or groupbox and loop over that cntainer.

Thanks Jim for your answer. I kinda get what your point is when you say 'write each paragraph as a separate line' but I've no clue on how to proceed with the coding haha.

Thanks by the way.

Hi Jim,
I attached screensot pf the simple program that I have made.

form1.jpgform2.jpgform3.jpgcodes.jpg

Need help on the save and open thingy. Thanks.

This article has been dead for over six months. Start a new discussion instead.