Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

Copy textbox data to a string

$
0
0
// I have a textBox and would like to copy its contents
// into a string called myColor

string myColor= "BLUE"; // OK works as expected
textBoxColor->Text = "BLUE"; // OK The textbox accepts a string literal
// But ... none of the following seems to work - all have errors
myColor = textBoxColor->Text;
myColor = textBoxColor.Text;
myColor = std::string( textBoxColor->Text);
myColor = System::String(textBoxColor->Text);
myColor = Convert.ToString(textBoxColor->Text);
myColor = System::Convert::ToString(textBoxColor->Text);
myColor = String::Parse(textBoxColor->Text);
myColor = textBoxColor->Text;
// ------------ Suggestions please
// Bob

Viewing all articles
Browse latest Browse all 3042

Trending Articles