Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能给出解决方案:当我/控制TableLayoutPanel_CellPaint()时事件没有触发。Invalidate()Update() TableLayoutPanel
TableLayoutPanel_CellPaint()
Invalidate()
Update()
TableLayoutPanel
不要尝试处理 OnCellPaintevent,而是尝试覆盖 TableLayoutPanel 类的 OnPaint 和/或 OnCellPaint 方法:
protected override void OnCellPaint(PaintEventArgs e) { base.OnCellPaint(e); // Your Code Here after the call to the base class. }
另外,尝试使用 Invalidate(true)。Boolean 参数指示控件是否应使其所有子控件无效。