1
我試圖在重繪樹狀圖時停止TreeView的垂直滾動條閃爍。我已經有了一個自定義的treeview控件,它可以使用WndProc來禁用繪畫,並且它對treeview本身工作正常,但是無論何時我在treeview中清除/創建節點時都不會停止重繪和閃爍的treeview滾動條。樹狀圖的滾動條掛起/恢復繪畫
有沒有解決這個問題的方法?這裏是自定義樹視圖的代碼:
private bool enablePaint = true;
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_PAINT:
if (enablePaint)
base.WndProc(ref m);
break;
case WM_ERASEBKGND:
break;
default:
base.WndProc(ref m);
break;
}
}
感謝您的任何幫助。
我敢肯定SuspendLayout和ResumeLayout使用LockWindowUpdate 「幕後」。但我可能是錯的。 –
我試過那些,即。用他們替換LockWindowUpdates,但垂直滾動條閃爍。 LWU是我發現的唯一解決方案。 – giangurgolo
-1不包含'private const int WM_SETREDRAW = 0xB;' – toddmo