Esempio n. 1
0
        /// <summary>
        /// 图片类型点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Dlbe_MouseClick(object sender, DuiMouseEventArgs e)
        {
            DuiLabel dlbe = sender as DuiLabel;

            if (dlbe.Tag != null)
            {
                Entity.MenuEntity.DataItem dt = (Entity.MenuEntity.DataItem)dlbe.Tag;
                if (dt.MenuName != userEntity.menuName)
                {
                    userEntity.menuName = dt.MenuVal.Replace("categoryID=", "");
                    startNo             = "1";
                    nCount   = "0";
                    SumPage  = "N";
                    isSearch = false;
                    Thread thread = new Thread(() => updateImgList(dt.MenuVal.Replace("categoryID=", ""), startNo));
                    thread.Start();
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 添加分类
        /// </summary>
        /// <param name="imgType">类型</param>
        /// <returns></returns>
        private Boolean addTypeLable(Entity.MenuEntity.DataItem imgType)
        {
            int      i    = (typeControl.Controls.Count / 1);
            DuiLabel dlbe = new DuiLabel();

            dlbe.Size        = new Size(60, 20);
            dlbe.Text        = imgType.MenuName;
            dlbe.Name        = "ImageTypeName_" + imgType.MenuName;
            dlbe.Location    = new Point(0, 5);
            dlbe.Cursor      = System.Windows.Forms.Cursors.Hand;
            dlbe.MouseMove  += Dlbe_MouseMove;
            dlbe.TextAlign   = ContentAlignment.MiddleCenter;
            dlbe.Tag         = imgType;
            dlbe.MouseClick += Dlbe_MouseClick;

            DuiLabel dLabel1 = new DuiLabel();

            dLabel1.Name        = "ImageTypeLine_" + imgType.MenuName;
            dLabel1.Cursor      = dlbe.Cursor;
            dLabel1.Size        = new Size(60, 2);
            dLabel1.BackColor   = System.Drawing.Color.Silver;
            dLabel1.Height      = 2;
            dLabel1.Tag         = imgType;
            dLabel1.Location    = new Point(0, 30);
            dLabel1.MouseClick += Dlbe_MouseClick;

            DuiBaseControl dlbControl = new DuiBaseControl();

            dlbControl.Size       = new Size(60, 35);
            dlbControl.Location   = new Point(61 * i, 0);
            dlbControl.MouseMove += Dlbe_MouseEnter;
            //dlbControl.MouseEnter += Dlbe_MouseEnter;
            dlbControl.MouseLeave += Dlbe_MouseLeave;
            dlbControl.Controls.AddRange(new DuiBaseControl[] { dlbe, dLabel1 });
            typeControl.Controls.Add(dlbControl);
            return(true);
        }