ERRORS C2227 and C2228!

I am trying to make a program on Microsoft Visual C++ which takes in your name and as output should say "Hello (Name)". I know a little about C++ and i got 2 errors.

1) error C2227: left of '->textBox1' must point to class/struct/union/generic type is 'const char [7]'

2)error C2228: left of '.Text' must have class/struct/union

The code of the Button which when pressed will change the text on label2 is-

1
2
3
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
				 label2 -> Text = "Hello "-> textBox1.Text; 
			 } 


Help Me! I got the rest running (Without the name part). I saw one few answers which could not help me. Please hive me an answer in simple terms.

Thank you.
natarajadithyan.
What is it?

label2 -> Text = "Hello "-> textBox1.Text;
label2 -> Text = "Hello "-> textBox1.Text;


may be it should be like this.
label2 -> Text = "Hello " +  textBox1.Text;
@HiteshVaghani1- I get an syntax error. I am supposed to use -> not +.
And the problem is anyway in the '.Text' part.

@vlad from moscow- That is the line of code which is supposed to display a text when press my button.
I have made a Paste bin of the entire thing which I believe is what is needed.

Link- http://pastebin.com/6Vdzsxm6
Topic archived. No new replies allowed.