Ejemplo n.º 1
0
        private void lstMultiVoucher_MeasureItem(object sender, MeasureItemEventArgs e)
        {
            if (e.Index < 0)
            {
                return;
            }

            multiVoucher x = (multiVoucher)lstMultiVoucher.Items[e.Index];

            e.ItemHeight = 35 * GetLinesNumber((string)x.ToString());
        }
Ejemplo n.º 2
0
        private void lstMultiVoucher_DrawItem(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();
            e.DrawFocusRectangle();

            if (e.Index < 0)
            {
                return;
            }

            multiVoucher x = (multiVoucher)lstMultiVoucher.Items[e.Index];

            e.Graphics.DrawString(
                x.ToString(),
                e.Font,
                new SolidBrush(e.ForeColor),
                e.Bounds);

            // draw some item separator
            e.Graphics.DrawLine(Pens.LightGray, e.Bounds.X, e.Bounds.Y + e.Bounds.Height - 2, e.Bounds.X + e.Bounds.Width, e.Bounds.Y + e.Bounds.Height - 2);
        }