Пример #1
0
        private void AddButton(zeus.HelperClass.zButton btn)
        {
            string location = btn.location;
            string limg     = btn.img;
            string key      = btn.key;

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);

            img[img_count]          = new zPictureBox();
            img[img_count].Location = new Point(X, Y);
            img[img_count].Image    = bmp;
            img[img_count].Size     = bmp.Size;
            img[img_count].Tag      = btn.value;
            img[img_count].key      = key;

            if ((string)img[img_count].Tag == "ok")
            {
                img[img_count].Visible = false;
                indexDalee             = img_count;
            }

            if (!string.IsNullOrEmpty(btn.value))
            {
                img[img_count].Click += new System.EventHandler(this.Pic_Click);
            }

            img_count++;
        }
Пример #2
0
        /// <summary>
        /// Добавление кнопки на форму главного меню (внутри группы) ver. 2.0
        /// </summary>
        /// <param name="frm"></param>
        /// <param name="img"></param>
        /// <param name="f"></param>
        /// <param name="tar"></param>
        public static void AddButton(zeus.HelperClass.zButton btn, ref PictureBox img, System.Windows.Forms.Form f, EventHandler tar)
        {
            string location = btn.location;
            string limg     = btn.img;
            string tag      = btn.value;

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap tmp = Ipaybox.Pics[int.Parse(Ipaybox.images[limg])];

            img           = new PictureBox();
            img.Location  = new Point(X, Y);
            img.Image     = tmp;
            img.Size      = tmp.Size;
            img.BackColor = Color.Transparent;
            img.Tag       = tag;
            // НЕРАБОТАЕТ
            img.Click += tar;
            f.Controls.Add(img);
        }