コード例 #1
0
        //Zobrazení serveru
        private void fillServerToLayout(string datadisk)
        {
            serverButtonsLogic();
            ServersflowLayoutPanel1.Controls.Clear();
            label1.Text = AppData.selectedDatadisk.datadiskName;


            //select servers by datadisk
            List <Server> servers = null;

            foreach (Datadisk d in AppData.Database)
            {
                if (d.datadiskName == datadisk)
                {
                    servers = d.servers;
                }
            }

            foreach (Server s in servers)
            {
                //vytvorim tabulku 1x2
                TableLayoutPanel Table = new TableLayoutPanel();
                Table = HomeScreen_Logic.CreateTable(1, 2);

                //Vytvorim si novy label a vlozim dotabulky
                Label l = new Label();
                l             = HomeScreen_Logic.CreateLabel(s.ServerName, 150, 40);
                l.TextAlign   = ContentAlignment.TopLeft;
                l.MouseClick += new MouseEventHandler(this.labelServer_Click);
                Table.Controls.Add(l, 1, 0);


                //vytvorim obrazek + nastavim jeho vlastnosti
                RLMS_NEW.Components.PictureBoxDT picture = new PictureBoxDT()
                {
                    Width = 16, Height = 16, SizeMode = PictureBoxSizeMode.StretchImage
                };
                picture             = HomeScreen_Logic.CreatePicture(16, 16, s.ServerName, s.Website);
                picture.MouseClick += new MouseEventHandler(this.pictureServer_Click); //po kliknuti na obrazek posle objekt metode p_Click
                Table.Controls.Add(picture, 0, 0);                                     //co chci pridat ,sloupec,radek

                ServersflowLayoutPanel1.Controls.Add(Table);                           //pridám tabulku do panelu
            }
        }
コード例 #2
0
        private void fillDatadisk()
        {
            DTflowLayoutContendWidth = 0;
            DataDiskflowLayoutPanel1.Controls.Clear();

            pictureBox_AddServer.Location = new Point(10, 10);

            int width  = 150;
            int height = 200;

            // DataDiskflowLayoutPanel1.Height = 100;

            //Zobrazení datadisku
            foreach (Datadisk d in AppData.Database)
            {
                //vytvorim tabulku 1x2
                TableLayoutPanel Table = new TableLayoutPanel();
                Table = HomeScreen_Logic.CreateTable(2, 1);


                //Vytvorim si novy label a vlozim dotabulky
                Label l = new Label();
                l = HomeScreen_Logic.CreateLabel(d.datadiskName, width, 70);
                Table.Controls.Add(l, 0, 1);

                //vytvorim obrazek + nastavim jeho vlastnosti
                RLMS_NEW.Components.PictureBoxDT picture = new PictureBoxDT();
                picture = HomeScreen_Logic.CreatePicture(width, height, d.datadiskName);

                picture.MouseClick += new MouseEventHandler(this.pictureDatadisk_Click); //po kliknuti na obrazek posle objekt metode p_Click
                picture.MouseEnter += new EventHandler(this.pictureDatadisk_MouseEnter);
                picture.MouseLeave += new EventHandler(this.pictureDatadisk_MouseLeave);

                DTflowLayoutContendWidth      += width + 15;
                DataDiskflowLayoutPanel1.Width = DTflowLayoutContendWidth;

                Table.Controls.Add(picture, 0, 0);            //co chci pridat ,sloupec,radek
                DataDiskflowLayoutPanel1.Controls.Add(Table); //pridám tabulku do panelu
                Home_screen_Resize(null, null);
            }
        }