Exemplo n.º 1
0
        /// <summary>
        /// 创建磁贴一个 第一行
        /// </summary>
        /// <param name="p_XIndex">水平序号</param>
        /// <param name="p_YIndex">垂直序号</param>
        UCFabITileFirstRow CreateFabTileFirstRowOne(int p_XIndex, int p_YIndex, int p_FirstColumnWidth)
        {
            int splitpixel           = 1;//间隔像素
            int tempWidth            = 97;
            UCFabITileFirstRow ucftr = new UCFabITileFirstRow();

            ucftr.Location = new System.Drawing.Point(p_XIndex * tempWidth + splitpixel * (p_XIndex + 1) + p_FirstColumnWidth, splitpixel);
            ucftr.Name     = "ucftfr" + (10000 * p_YIndex + p_XIndex);
            //ucft.Size = new System.Drawing.Size(tempWidth, tempHeight);
            //ucft.TabIndex = 1000 * p_YIndex + p_XIndex;
            ucftr.MouseClick += new MouseEventHandler(panGroup_MouseClick);//快速点击及滚动用
            return(ucftr);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 创建磁贴
        /// </summary>
        /// <param name="dtSource">数据源,列0/1/2/3/4:选择标志/BoxNo/卷号/数量/缸号</param>
        /// <param name="p_ColumnCount">列数量</param>
        void CreateFabTile(DataTable dtSource, int p_ColumnCount)
        {
            panGroup.Controls.Clear();//清除界面上所有控件
            int firstColumnWidth = 46 + 1;
            int firstRowHeight   = 27 + 1;

            for (int i = 0; i < dtSource.Rows.Count; i++)
            {
                int xIndex = i % p_ColumnCount; //水平 取余
                int yIndex = i / p_ColumnCount; //垂直 取整

                int colorIndex = 1;             //色系
                //if (xIndex % 2 == 1)//取余
                //{
                //    colorIndex = 2;
                //}


                if (xIndex == 0)//创建一个起始列
                {
                    UCFabITileFirstColumn ucftc = CreateFabTileFirstColumnOne(xIndex, yIndex, firstRowHeight);
                    ucftc.UCRowIndex = yIndex + 1;
                    panGroup.Controls.Add(ucftc);
                }
                if (yIndex == 0)//创建一个起始行
                {
                    UCFabITileFirstRow ucftr = CreateFabTileFirstRowOne(xIndex, yIndex, firstColumnWidth);
                    ucftr.UCColIndex = xIndex + 1;
                    panGroup.Controls.Add(ucftr);
                }

                UCFabITile ucft = CreateFabTileOne(xIndex, yIndex, firstColumnWidth, firstRowHeight);
                ucft.UCBackColorIndex = colorIndex;
                ucft.DrSource         = dtSource.Rows[i];
                ucft.UCRowIndex       = i;

                panGroup.Controls.Add(ucft);

                Application.DoEvents();
            }
        }