A HeaderRenderer that draws gradient Column headers
Inheritance: HeaderRenderer
Exemple #1
0
        private void InitPlugInGrid()
        {
            Table table = this.tablePlugIns;       // The Table control on a form - already initialised

            table.BeginUpdate();
            table.SelectionStyle = SelectionStyle.ListView;
            table.GridLines = GridLines.None;
            table.FullRowSelect = true;
            table.NoItemsText = "";
            //table.EnableWordWrap = false;

            TextColumn col1 = new TextColumn(Translator.Instance.T("类别"), 100);
            TextColumn col2 = new TextColumn(Translator.Instance.T("名称"), 100);
            TextColumn col3 = new TextColumn(Translator.Instance.T("作者"), 100);
            TextColumn col4 = new TextColumn(Translator.Instance.T("版本"), 100);
            TextColumn col5 = new TextColumn(Translator.Instance.T("描述"), 100);
            TextColumn col6 = new TextColumn(Translator.Instance.T("文件"), 100);

            table.ColumnModel = new ColumnModel(new Column[] { col1, col2, col3, col4, col5, col6 });
            foreach (Column col in table.ColumnModel.Columns)
            {
                col.Resizable = true;
                col.Editable = false;
            }

            Font ft = SystemFonts.MessageBoxFont;
            table.HeaderFont = new Font(ft.FontFamily.Name, ft.Size, FontStyle.Bold);

            table.TableModel = new TableModel();
            table.TableModel.RowHeight = TextRenderer.MeasureText("ABCbp", table.Font).Height + 2;

            GradientHeaderRenderer gradientRenderer = new GradientHeaderRenderer();
            table.HeaderRenderer = gradientRenderer;

            table.EndUpdate();
        }
Exemple #2
0
        private void ListInitialize()
        {
            Table table = this.tableModules;       // The Table control on a form - already initialised

            table.BeginUpdate();
            table.SelectionStyle = SelectionStyle.ListView;
            table.GridLines = GridLines.None;
            table.FullRowSelect = true;
            table.NoItemsText = "";
            //table.EnableWordWrap = true;

            table.ColumnModel = this.ColumnInitialize();

            Font ft = SystemFonts.MessageBoxFont;
            table.HeaderFont = new Font(ft.FontFamily.Name, ft.Size, FontStyle.Bold);

            table.TableModel = new TableModel();
            table.TableModel.RowHeight = TextRenderer.MeasureText("ABCbp", table.Font).Height + 2;

            GradientHeaderRenderer gradientRenderer = new GradientHeaderRenderer();
            table.HeaderRenderer = gradientRenderer;

            table.EndUpdate();
        }