Exemple #1
0
 private void xemtruoc()
 {
     fpnlXemTruoc.Controls.Clear();
     foreach (object ob in listObject)
     {
         if (ob is BunifuTextBox)
         {
             BunifuLabel lblmt = new BunifuLabel();
             lblmt.Size = new Size(fpnlXemTruoc.Width - 50, 1000);
             BunifuTextBox temp = (BunifuTextBox)ob;
             lblmt.Font = new Font("Arial", 12, FontStyle.Regular);
             lblmt.Text = temp.Text;
             this.fpnlXemTruoc.Controls.Add(lblmt);
         }
         else if (ob is Image)
         {
             PictureBox pic = new PictureBox();
             Image      img = (Image)ob;
             pic.Size     = new Size((fpnlXemTruoc.Size.Width - 50), (fpnlXemTruoc.Size.Width - 50) * img.Size.Height / img.Size.Width);
             pic.Image    = img;
             pic.SizeMode = PictureBoxSizeMode.Zoom;
             this.fpnlXemTruoc.Controls.Add(pic);
         }
     }
     fpnlXemTruoc.VerticalScroll.Value = fpnlXemTruoc.VerticalScroll.Maximum;
 }
Exemple #2
0
        public Panel CreateNoEntryInfo()
        {
            Panel       p_noentry = new Panel();
            BunifuLabel lbl_h1inf = new BunifuLabel();
            PictureBox  pb_ico    = new PictureBox();

            p_noentry.Controls.Add(lbl_h1inf);
            p_noentry.Controls.Add(pb_ico);
            this.bunifuTransition1.SetDecoration(p_noentry, Bunifu.UI.WinForms.BunifuTransition.DecorationType.None);
            p_noentry.Location = new System.Drawing.Point(3, 3);
            p_noentry.Name     = "p_noentry";
            p_noentry.Size     = new System.Drawing.Size(805, 648);
            p_noentry.TabIndex = 0;
            p_noentry.Visible  = true;

            lbl_h1inf.AllowParentOverrides = false;
            lbl_h1inf.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
            lbl_h1inf.AutoEllipsis = false;
            lbl_h1inf.AutoSize     = false;
            lbl_h1inf.CursorType   = null;
            this.bunifuTransition1.SetDecoration(lbl_h1inf, Bunifu.UI.WinForms.BunifuTransition.DecorationType.None);
            lbl_h1inf.Font          = new System.Drawing.Font("Microsoft Sans Serif", 25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            lbl_h1inf.ForeColor     = System.Drawing.Color.Black;
            lbl_h1inf.Location      = new System.Drawing.Point(238, 241);
            lbl_h1inf.Name          = "lbl_h1loading";
            lbl_h1inf.RightToLeft   = System.Windows.Forms.RightToLeft.No;
            lbl_h1inf.Size          = new System.Drawing.Size(484, 139);
            lbl_h1inf.TabIndex      = 24;
            lbl_h1inf.Text          = "<h2>kayıt bulunamadı !</h1>";
            lbl_h1inf.TextAlignment = System.Drawing.ContentAlignment.TopLeft;
            lbl_h1inf.TextFormat    = Bunifu.UI.WinForms.BunifuLabel.TextFormattingOptions.Default;
            lbl_h1inf.Visible       = true;
            //
            // pb_h1loading
            //
            pb_ico.BackgroundImage       = ((System.Drawing.Image)(Resources.empty_icon_0));
            pb_ico.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.bunifuTransition1.SetDecoration(pb_ico, Bunifu.UI.WinForms.BunifuTransition.DecorationType.None);
            pb_ico.Location = new System.Drawing.Point(134, 265);
            pb_ico.Name     = "pb_h1loading";
            pb_ico.Size     = new System.Drawing.Size(98, 94);
            pb_ico.TabIndex = 23;
            pb_ico.TabStop  = false;
            pb_ico.Visible  = true;
            p_panel.Controls.Add(p_noentry);
            p_noentry.BringToFront();
            return(p_noentry);
        }
Exemple #3
0
 private void getPokeNum()
 {
     con.Open();
     cmd = new MySqlCommand("Select Number, Name from pokemondb", con);
     dr  = cmd.ExecuteReader();
     while (dr.Read())
     {
         label            = new BunifuLabel();
         label.Text       = dr["Number"].ToString();
         label.BackColor  = Color.Transparent;
         label.ForeColor  = Color.White;
         label.Font       = new Font("Roboto", 14);
         label.Cursor     = Cursors.Hand;
         label.Tag        = dr["Name"].ToString();
         label.CursorType = Cursors.Hand;
         PokeFlowPanel.Controls.Add(label);
         label.Click += new EventHandler(onClick);
     }
     dr.Close();
     con.Close();
 }
Exemple #4
0
        private void Load_Form()
        {
            List <string> list_top  = new List <string>();
            DataTable     dataTable = Data.Instance.Load_SP(_masp);

            if (dataTable.Rows[0] != null)
            {
                DataRow row = dataTable.Rows[0];
                sp = new SanPham();
                sp = Data.Instance.Load_SP_byMaSP(_masp, c);
                lblTenSanPham.Text = sp.TenSP;
                //lblThuongHieuText.Text = sp.NhaSX;
                lblGia.Text        = giaFix(sp.Gia);
                lblnhanxetnum.Text = Data_NhanXet.Instance.countRate(_masp).ToString() + " nhận xét";
                //lblXuatXu.Text = sp.XuatXu;
                picSanPhamMain.SizeMode = PictureBoxSizeMode.Zoom;
                picSanPhamMain.Image    = Picture.LoadImage_by_ID(sp.link_image[0]);
                picAnh1.SizeMode        = PictureBoxSizeMode.Zoom;
                picAnh1.Image           = Picture.LoadImage_by_ID(sp.link_image[1]);
                picAnh2.SizeMode        = PictureBoxSizeMode.Zoom;
                picAnh2.Image           = Picture.LoadImage_by_ID(sp.link_image[2]);
                picAnh3.SizeMode        = PictureBoxSizeMode.Zoom;
                picAnh3.Image           = Picture.LoadImage_by_ID(sp.link_image[3]);
            }
            List <SanPhamRecommend> listsp_re = Data.Instance.loadRecommend(_masp);

            foreach (SanPhamRecommend sp in listsp_re)
            {
                ucRecommendSanPham uc = new ucRecommendSanPham(this.parent, sp.Masp, sp.Ten, sp.Gia, sp.Link_Image);
                this.fpnlSanPhamTuongTu.Controls.Add(uc);
            }

            /*for (int j = 0; j < 2; j++)
             * {
             *  ucRecommendSanPham uc = new ucRecommendSanPham();
             *  this.fpnlSanPhamTuongTu.Controls.Add(uc);
             * }*/
            /* for (int x = 0; x < 2; x++)
             * {
             *   ucRecommendSanPham uc = new ucRecommendSanPham();
             *   this.fpnlSanPhamTuongTu.Controls.Add(uc);
             * }*/

            //load mo ta chi tiet
            List <string> listmota    = new List <string>();
            List <string> listHinhAnh = new List <string>();
            List <object> listObject  = new List <object>();

            listmota    = Data.Instance.listMoTa(sp.MASP);
            listHinhAnh = Data.Instance.listImageLink(sp.MASP);
            int index = 0, i = 0, j = 0;

            int.TryParse(sp.IndexMoTa, out index);
            while (index != 0)
            {
                if (index % 10 == 1)
                {
                    index = index / 10;
                    BunifuTextBox txtChiTietAdd = new BunifuTextBox();
                    string        s             = listmota[i++];
                    //   txtChiTietAdd.Text = listmota[i++];
                    listObject.Add(s);
                }
                else if (index % 10 == 2)
                {
                    index = index / 10;
                    Image picLink = Picture.LoadImage_by_ID(listHinhAnh[j++]);
                    listObject.Add(picLink);
                }
            }
            fpnlThongTinSP.Controls.Clear();
            foreach (object ob in listObject)
            {
                if (ob is string)
                {
                    BunifuLabel lblmt = new BunifuLabel();
                    lblmt.MaximumSize = new Size(fpnlThongTinSP.Size.Width + 300, 1000);
                    string temp = (string)ob;
                    lblmt.Font = new Font("Arial", 15, FontStyle.Regular);
                    lblmt.Text = temp;
                    this.fpnlThongTinSP.Controls.Add(lblmt);
                }
                else if (ob is Image)
                {
                    PictureBox pic = new PictureBox();
                    Image      img = (Image)ob;
                    pic.Size     = new Size((fpnlThongTinSP.Size.Width + 300), (fpnlThongTinSP.Size.Width + 300) * img.Size.Height / img.Size.Width);
                    pic.Image    = img;
                    pic.SizeMode = PictureBoxSizeMode.Zoom;
                    this.fpnlThongTinSP.Controls.Add(pic);
                }
            }
            // fpnlThongTinSP.VerticalScroll.Value = fpnlThongTinSP.VerticalScroll.Maximum;
        }