Advertisement

03.16.2008 at 12:38PM PDT, ID: 23245557
[x]
Attachment Details

need help with MS VISUAL c++ string

Asked by griunvaldo in Microsoft Visual C++.Net

Tags: c++

Take a look at this code:
What i want is, to declare one time string and to set it value, so i don't need to write it's value lots of times for each button and so on...Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                                 
                        
 
           Guy="Andrew";
 
 
             textBox1->Text = Guy;
 
                         }
        private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
            //Guy="Andrew"; Why not work without it? I dont want to write Guy value each time for each button for example :/ I want to declare it and its value just one time. How could i do that?
             textBox1->Text = Guy; 
 
                         }
 
         public:
 
                         System::String^  Guy;
[+][-]03.16.2008 at 12:46PM PDT, ID: 21138172

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.16.2008 at 12:50PM PDT, ID: 21138186

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual C++.Net
Tags: c++
Sign Up Now!
Solution Provided By: LordOfPorts
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628