title: Declare variables in Microsoft Visual C++?
body: <p>Where should i declare the variables i like to use in windows forms? </p>
  
  <pre><code>    private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
  
       int iMyvariable = 1;
  
     }
  
      private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  
       iMyvariable++;
     }
  </code></pre>
  
  <p>Running the code gives the following error:</p>
  
  <blockquote>
    <p>error C2065: 'iMyvariable' : undeclared identifier</p>
  </blockquote>