我在单个 DataGridView 列中有不同类型的单元格。
当用户单击该框时,它曾经完全变黑。
现在我可以从 EditingControlShowing 事件中捕获 Entered 事件并将 backgroundColor 设置为白色。
private void ATextBoxHasBeenEntered(object sender, EventArgs e)
{
((TextBox)sender).BackColor = Color.White;
((TextBox)sender).TextAlign = HorizontalAlignment.Left;
((TextBox)sender).BorderStyle = System.Windows.Forms.BorderStyle.None;
}
但我仍然看到这个黑匣子!
所以我疯狂地试图抓住每个相关的对象并将其设置为白色。我尝试将关联的 DataGridViewTextBox 的背景设置为白色,从所有内容中删除边框等。
没有任何效果:(
我不知道这个黑框是 DataGridViewTextBox 还是编辑控件。我也不知道是什么事件改变了颜色。
我能做些什么?