Exemplo n.º 1
0
        private void tbxSizes_TextChanged(object sender, EventArgs e)
        {
            int res = 0;

            ColumnDisplay[] sizes = ColumnDisplay.GetSizes(tbxSizes.Text);

            if (sizes != null)
            {
                res = sizes.Sum(col => col.Size);
            }

            lblTotalSize.Text = String.Format("Total Size = {0}", res);
        }
Exemplo n.º 2
0
        public override void AlignColumn(Point pt, ContentAlignment alignement)
        {
            if (this.TestPanel == null)
            {
                return;
            }

            Control ctr = this.TestPanel.GetChildAtPoint(pt);
            Label   lbl = ctr as Label;

            if (lbl == null || lbl.Tag == null)
            {
                return;
            }

            int columnIndex = Convert.ToInt32(lbl.Tag);

            if (tbxSizes.Text.Length > 0)
            {
                ColumnDisplay[] dd = ColumnDisplay.GetSizes(tbxSizes.Text);
                dd[columnIndex].Alignement = ConvertAlignment(alignement);

                tbxSizes.Text = Tools.SizesToText(dd);
            }

            //lbl.TextAlign = alignement;

            foreach (Label c in this.TestPanel.Controls)
            {
                if (c == null || c.Tag == null)
                {
                    continue;
                }
                int col = Convert.ToInt32(c.Tag);
                if (col == columnIndex)
                {
                    c.TextAlign = alignement;
                }
            }
        }