FdoToolbox.Base.Controls.FdoCreateDataStoreCtl.grdConnectionProperties_CellPainting C# (CSharp) Method

grdConnectionProperties_CellPainting() private method

private grdConnectionProperties_CellPainting ( object sender, DataGridViewCellPaintingEventArgs e ) : void
sender object
e DataGridViewCellPaintingEventArgs
return void
        private void grdConnectionProperties_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
        {
            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {
                DataGridViewCell cell = grdConnectionProperties.Rows[e.RowIndex].Cells[e.ColumnIndex];
                if (cell != null && IsPasswordCell(cell) && cell.Value != null)
                {
                    e.Paint(e.CellBounds, DataGridViewPaintParts.All & ~DataGridViewPaintParts.ContentForeground);
                    Graphics g = e.Graphics;
                    g.DrawString(new string('*', cell.Value.ToString().Length), this.Font, new SolidBrush(Color.Black), e.CellBounds);
                    e.Handled = true;
                }
            }
        }