giovedì 21 agosto 2014

System::Drawing::Size. Il form che cambia larghezza a ogni pressione sul button

Ed ecco il form che cambia larghezza alternativamente a ogni click del button:
 private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
    }
 private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    
     if(this->Size.Width<1000)
     {
      this->Size=System::Drawing::Size(1100,this->Size.Height);
     }
     else{
      this->Size=System::Drawing::Size(900,this->Size.Height);
     }
    
    }
 };

Nessun commento:

Posta un commento