Ejemplo n.º 1
0
        private void BackimgPanLoad()
        {
            foreach (Control control in BackimgPan.Controls)
            {
                if (control.GetType() == typeof(PicturePicker))
                {
                    control.Visible = false;
                    //((Shell.FormControlTagData)control.Tag).needDispose = true;
                }
            }
            DirectoryInfo d = new DirectoryInfo(SYS.path + @"\User\Common\LoginImg");
            Int32         n = 0, x = 0, y = 0;

            foreach (var file in d.EnumerateFiles())
            {
                PicturePicker p = new PicturePicker();
                x = n % 4;
                y = n / 4;
                Shell.FormControlTagData dat = new FormControlTagData();
                p.Tag = dat;
                BackimgPan.Controls.Add(p);
                p.Size     = new Size((BackimgPan.Width / 4 - 6) - 6, BackimgPan.Height / 3 - 8);
                p.Location = new Point((BackimgPan.Width / 4 - 6) * x + 3, BackimgPan.Height / 3 * y + 10 + label1.Height);
                p.Image    = new Bitmap(new Temp().LoadFile(file.FullName));
                n++;
                //Timer1.AddControl(p);
            }
        }
Ejemplo n.º 2
0
 private void CleanMemory(object sender, EventArgs e)
 {
     foreach (var pcon in ConList)
     {
         Control            con = Control.FromHandle(pcon);
         FormControlTagData dat = (Shell.FormControlTagData)con.Tag;
         if (dat.needDispose = true)
         {
             con.Dispose();
             ConList.Remove(pcon);
         }
     }
 }