help! i need an answer asap!

mbacarra

Newcomer
Joined
Sep 14, 2005
Messages
7
well, my groupmates and i are working on a project. we're creating a new programming language and we're using c#. i'm new to this obviously that's why i need all the help i can get.

i have a tabcontrol where i can programmatically create a textbox added in a tabpage in the said tabcontrol using the "open" and "new" on my menu. i was able to do the "open" menu by reading from a file and setting it as the text of an instantiated textbox added in an instantiated tabpage. the problem is i cannot get the text from a textbox so that i could create a file and "save" it there.

please help me. i would really appreciate your help! thank you very much!
 
I'm confused as to what you're doing (we're creating a new programming language...?). But, to save out the contents of a textbox to a file:
System.IO.File.CreateText("c:\\test.txt").Write(textBox1.Text);

That's all in one shot, obviously you should break that down and check for errors, etc. You said you needed something asap, and I hate that kind of pressure!

A lack of planning on your part does not constitute and emergency on my part

Good luck with the assignement!

-ner
 
Will a newly instantiated textbox actually contain the text that was in it, or just the properties of the object itself? If I am reading this correctly, maybe try to save the text from the box in a .txt file, then instatiate the new textBox object, then add the saved text to the new textBox.
 
Nerseus said:
I'm confused as to what you're doing (we're creating a new programming language...?). But, to save out the contents of a textbox to a file:
System.IO.File.CreateText("c:\\test.txt").Write(textBox1.Text);

That's all in one shot, obviously you should break that down and check for errors, etc. You said you needed something asap, and I hate that kind of pressure!



Good luck with the assignement!

-ner

it's a project. our task is to create a programming language.

you know, i wouldn't ask something i already know, and if you're pressured, then don't. i was asking people in this forum who 'can' and 'are willing to' help. and i said "i need help asap" because we have a deadline, and as i've said it's a project. i came here to ask for help, because i am not knowledgeable with such stuff. compared to you, i'm just a neophyte.
 
clarifications

ok here's the thing. i have a tabcontrol that programmatically creates tabpages with a textbox in it. i have a menubar with "open", "new" and "save" menu in it. the "new" menu creates a tabpage with a blank textbox. the "open" menu opens and reads files (under a filter), then creates a tabpage with a textbox containing the data inside the file. think of it as a notepad, only you can open multiple files via the tabcontrol.

here's the problem. the save menu is supposed to create a file, reads the text on textbox of a selected (current/active) tabpage and writes it on the file. what i was asking before was how can i access the text on the textbox that was added in a tabpage,which, of course,is added on the tabcontrol

i hope that clears some of the questions.
 
*applause* It worked!!! thanks a lot! and i really mean A LOT! *whew* and to think i was trying to figure that one out since a few weeks ago.

thanks a lot!
 
Back
Top