sudhavelvizhi
March 24th, 2009, 02:33 AM
Plz any one help me to create an editable textbox in CLR application?
Its vary urgent
Its vary urgent
|
Click to See Complete Forum and Search --> : how to create editable list box sudhavelvizhi March 24th, 2009, 02:33 AM Plz any one help me to create an editable textbox in CLR application? Its vary urgent cilu March 24th, 2009, 02:44 AM [ redirected ] sudhavelvizhi, what is wrong with you? Why do you keep posting CLR question in the VC++ forum when you know there is a C++/CLI forum, because you already posted here. Moreover, don't create duplicate threads (in the same or across different forums) for the same topic. This is against the rules of the forum. In win forms applications, edit boxes are called text boxes. You don't have to do anything special to be editable. Just drag a text box on your form. sudhavelvizhi March 24th, 2009, 02:55 AM Sir, Initially i dont know abt this forum... Now only one member asked me to post the question there. So only i posted the quetion there. But in text box is it possible to display a text file content, allow the user to change it and save it. I'm new to this language, help me in this sunny_sz March 24th, 2009, 03:28 AM But in text box is it possible to display a text file content, allow the user to change it and save it. Contents in text box itself can be edit by users in fact, of course you can change it and save it into a file etc. cilu March 24th, 2009, 03:31 AM Read the file and put the content to the text box. Use the Text property of it. Then, after you edit it, write the value of the Text property to a file (the same one). sudhavelvizhi March 24th, 2009, 04:17 AM Sir for writing to the text box from a text file i hav used the following statement, String^ textFile=String::Concat(win,"E:\\TC\\BIN\\prefix.txt"); StreamReader ^reader=gcnew StreamReader(textFile); do { textBox1->AppendText(reader->ReadLine()); textBox1->AppendText("\n"); } while(reader->Peek() != -1); How to write the text box content to a text file? sudhavelvizhi March 24th, 2009, 05:50 AM What is wrong with the following? I'm using this to write content from text box to a text file. StreamWriter ^writer=gcnew StreamWriter(text); writer->Write(textBox1->Text); sudhavelvizhi March 24th, 2009, 05:55 AM The text file contains more than one line..... Anybody plz help me. I need to submit it by tomorrow. sudhavelvizhi March 24th, 2009, 07:25 AM I hav made use of the following code, but i'm getting the output in the text file in a single line. Like this, 3.0.0.04.0.0.0/94.0.0.04.21.103.0/244.23.112.0/24 But i hav to get each in single line, as below, 3.0.0.0 4.0.0.0/9 4.0.0.0 4.21.103.0/24 4.23.112.0/24 The coding i used is, private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { //String^ text=String::Concat(win,"E:\\TC\\BIN\\ex.txt"); String ^text="E:\\TC\\BIN\\ex.txt"; System::IO::StreamWriter ^writer=gcnew System::IO::StreamWriter(text); writer->WriteLine(textBox1->Text); writer->Close(); } How to print each in new line? darwen March 24th, 2009, 07:05 PM Please use code tags. Click on 'go advanced' button when posting and click the 'code' button in the same line as the 'bold', 'italic' etc buttons. You can use the TextBox's Lines property e.g. String ^text="E:\\TC\\BIN\\ex.txt"; System::IO::StreamWriter ^writer=gcnew System::IO::StreamWriter(text); foreach (String ^line in textBox1->Lines) { writer->WriteLine(line); } writer->Close(); Bear in mind the folder E:\TC\BIN has to exist. Look at the System::IO::Directory::CreateDirectory (http://msdn.microsoft.com/en-us/library/system.io.directory.createdirectory.aspx) function to create directories. Darwen. sudhavelvizhi March 24th, 2009, 11:20 PM Thank u sir... I hav got the output.. Sir, To compile a C from VC++ residing in E:\TC\BIN, i used the following coding, System::Diagnostics::Process::Start("E:\\TC\\BIN\\tc.exe","E:\\TC\\BIN\\dst3.c"); But using this, only the tc IDE with this program is opened. But i hav to compile it sir. Is there is any possibility to extend this to achieve? codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved. |