예제 #1
0
 private void button10_Click(object sender, EventArgs e)
 {
     if (this.attheendofDB)
     {
         int num = (int)MessageBox.Show("There are no more images to be seen", "End of database", MessageBoxButtons.OK);
     }
     else
     {
         for (int index = 0; index < 10; ++index)
         {
             Button button = new Button();
             button.Name = MySQLHandle.getshowedID().ToString();
             Image lastUnseenImage = MySQLHandle.getLastUnseenImage();
             button.Image = lastUnseenImage;
             button.Text  = MySQLHandle.getInfoString();
             button.Size  = new Size(lastUnseenImage.Width, lastUnseenImage.Height);
             this.flowLayoutPanel1.Controls.Add((Control)button);
             button.Click += new EventHandler(this.imageButtonDownload_Click);
             if (MySQLHandle.lastseenID == 1)
             {
                 this.attheendofDB = true;
                 break;
             }
         }
     }
 }
예제 #2
0
 private void button9_Click(object sender, EventArgs e)
 {
     flowLayoutPanel1.Size     = new Size(this.Width - 25, this.Height - 53);
     flowLayoutPanel1.Location = new Point(25, 53);
     if (!this.ineditor)
     {
         this.button1.Visible          = true;
         this.button6.Visible          = true;
         this.button7.Visible          = true;
         this.button8.Visible          = true;
         this.button2.Visible          = true;
         this.button3.Visible          = true;
         this.button4.Visible          = true;
         this.button5.Visible          = true;
         this.button10.Visible         = false;
         this.label1.Visible           = true;
         this.label2.Visible           = true;
         this.label3.Visible           = true;
         this.label4.Visible           = true;
         this.label5.Visible           = true;
         this.trackBar1.Visible        = true;
         this.PictureBox1.Visible      = true;
         this.flowLayoutPanel1.Visible = false;
         this.button9.Text             = "Show other's images";
         this.button9.Location         = new Point(12, 99);
         this.ineditor = true;
     }
     else
     {
         this.button1.Visible                = false;
         this.button6.Visible                = false;
         this.button7.Visible                = false;
         this.button8.Visible                = false;
         this.button2.Visible                = false;
         this.button3.Visible                = false;
         this.button4.Visible                = false;
         this.button5.Visible                = false;
         this.button10.Visible               = true;
         this.label1.Visible                 = false;
         this.label2.Visible                 = false;
         this.label3.Visible                 = false;
         this.label4.Visible                 = false;
         this.label5.Visible                 = false;
         this.trackBar1.Visible              = false;
         this.PictureBox1.Visible            = false;
         this.button9.Text                   = "Back to editor";
         this.button9.Location               = new Point(12, 12);
         this.flowLayoutPanel1.Visible       = true;
         this.flowLayoutPanel1.Location      = new Point(13, 41);
         this.flowLayoutPanel1.AutoScroll    = true;
         this.flowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft;
         this.flowLayoutPanel1.WrapContents  = true;
         this.ineditor = false;
         MySQLHandle.firsttimeGetShowedID = true;
         if (this.attheendofDB)
         {
             int num = (int)MessageBox.Show("There are no more images to be seen", "End of database", MessageBoxButtons.OK);
         }
         else
         {
             for (int index = 0; index < 10; ++index)
             {
                 Button button = new Button();
                 button.Name = MySQLHandle.getshowedID().ToString();
                 Image lastUnseenImage = MySQLHandle.getLastUnseenImage();
                 button.Image     = lastUnseenImage;
                 button.Text      = MySQLHandle.getInfoString();
                 button.Size      = new Size(lastUnseenImage.Width, lastUnseenImage.Height);
                 button.ForeColor = Color.White;
                 button.Click    += new EventHandler(this.imageButtonDownload_Click);
                 this.flowLayoutPanel1.Controls.Add((Control)button);
                 if (MySQLHandle.lastseenID == 1)
                 {
                     this.attheendofDB = true;
                     break;
                 }
             }
         }
     }
 }