예제 #1
0
        private void fl_PaintItemContent(object sender, PaintItemContentEventArgs e)
        {
            fl.DrawItemBackgound(e.Graphics, e.Info);
            fl.DrawItemIcons(e.Graphics, e.Info);

            if (e.Info.ItemIndex == expandedItemIndex)
            {
                //custom drawing
                var rect = new Rectangle(e.Info.X_Text, e.Info.Y, e.Info.X_End - e.Info.X_Text + 1, e.Info.Height);

                using (var brush = new SolidBrush(Color.WhiteSmoke))
                    e.Graphics.FillRectangle(brush, rect);

                using (var pen = new Pen(Color.Navy))
                    e.Graphics.DrawRectangle(pen, rect);

                using (var brush = new SolidBrush(e.Info.ForeColor))
                {
                    var text = string.Format("It is expanded block\r\nItemIndex: {0}\r\nY: {1}    Height: {2}", e.Info.ItemIndex, e.Info.Y, e.Info.Height);
                    e.Graphics.DrawString(text, fl.Font, brush, rect);
                }
            }
            else
            {
                //default drawing
                e.Info.Text = "Item " + e.Info.ItemIndex;
                fl.DrawItemContent(e.Graphics, e.Info);
            }
        }
예제 #2
0
        private void fl_PaintItemContent(object sender, PaintItemContentEventArgs e)
        {
            fl.DrawItemBackgound(e.Graphics, e.Info);
            fl.DrawItemIcons(e.Graphics, e.Info);

            if (e.Info.ItemIndex == expandedItemIndex)
            {
                //custom drawing
                var rect = new Rectangle(e.Info.X_Text, e.Info.Y, e.Info.X_End - e.Info.X_Text + 1, e.Info.Height);

                using (var brush = new SolidBrush(Color.WhiteSmoke))
                    e.Graphics.FillRectangle(brush, rect);

                using (var pen = new Pen(Color.Navy))
                    e.Graphics.DrawRectangle(pen, rect);

                using (var brush = new SolidBrush(e.Info.ForeColor))
                {
                    var text = string.Format("It is expanded block\r\nItemIndex: {0}\r\nY: {1}    Height: {2}", e.Info.ItemIndex, e.Info.Y, e.Info.Height);
                    e.Graphics.DrawString(text, fl.Font, brush, rect);
                }
            }
            else
            {
                //default drawing
                e.Info.Text = "Item " + e.Info.ItemIndex;
                fl.DrawItemContent(e.Graphics, e.Info);
            }
        }