i am new to this platform and i want to retrive the data from textfield on the click of a button ,how to do this please help me
+1
A:
Add a new project of type "Visual C++/CLR/Windows Forms Application" to your solution.
Add a button and textbox to the designer.
Double-click the button on the designer. This should take you to the form code, where an event handler will have been created and registered for you.
In the body of that event handler, you may access the text field using its name from the design (the name is viewed/modified by right-clicking the item in the form designer and selecting "Properties").
Edit: I typically don't use C++ for Windows Forms applications, but this example seems to work:
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
System::String^ txt = this->textBox1->Text;
txt += " augmented";
this->textBox1->Text = txt;
}
Adam
2010-03-23 16:29:59
can you please tell me a sample code how to do it,framework used is win32 form the code isprivate: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { this->AcceptButton } private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) { }
suman
2010-03-23 16:44:15
thanks a lot dude...........
suman
2010-03-23 17:19:04
If you got that code it is a managed project (actually, it's C++/CLI), the framework is the .NET framework and the graphic toolkit is WinForms. <_< By the way, to post that additional info you should edit your original question, so that the code is formatted and indented correctly and other people willing to answer can find immediately all the information needed to answer.
Matteo Italia
2010-03-23 17:35:45
ok...i have another query....i get the textbox data store it into string format,there are some values as numbers,can i change these string numbers into int format
suman
2010-03-24 13:16:47