コード例 #1
0
ファイル: Globals.cs プロジェクト: sillsdev/FwSupportTools
        protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
        {
            NumberedDataGrid oGrid = this.DataGridTableStyle.DataGrid as NumberedDataGrid;

            if (oGrid != null)
            {
                oGrid.SetRowPaintIndex(rowNum);
            }
            base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
        }
コード例 #2
0
ファイル: Globals.cs プロジェクト: sillsdev/FwSupportTools
        protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
        {
            DataGrid         oGrid    = this.DataGridTableStyle.DataGrid;
            NumberedDataGrid oNumGrid = oGrid as NumberedDataGrid;
            int  iCol       = -1;
            bool fHilighted = false;

            if (oNumGrid != null)
            {
                oNumGrid.SetRowPaintIndex(rowNum);
                DataTable oTable = oNumGrid.GetDataTableFromDataSource();
                if (oTable != null)
                {
                    DataColumn oCol = oTable.Columns[this.MappingName];
                    if (oCol != null)
                    {
                        iCol = oCol.Ordinal;
                    }
                }
                if (oNumGrid.AreColumnsSelected())
                {
                    fHilighted = oNumGrid.IsColumnSelected(iCol);
                }
                else
                {
                    fHilighted = oGrid.IsSelected(rowNum) ||
                                 (source.Position == rowNum && oGrid.CurrentCell.ColumnNumber == iCol);
                }
            }
            else
            {
                fHilighted = oGrid.IsSelected(rowNum) ||
                             (source.Position == rowNum && oGrid.CurrentCell.ColumnNumber == iCol);
            }

            if (fHilighted)
            {
                foreBrush = SystemBrushes.HighlightText;
                backBrush = SystemBrushes.Highlight;
            }
            else
            {
                foreBrush = SystemBrushes.WindowText;
                backBrush = SystemBrushes.Window;
            }
            base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
        }