15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Flashing TreeViewCtrl

Jim Leavitt -- jimll@halcyon.com
Sunday, January 28, 1996

Hi...
I've got a problem I know someone out there has solved, and I'm tired of =
digging around for the solution! I'm using VC4 under Windows 95.

I've got a static splitter window. One pane has a CTabView (my own =
extension, inherited from CCtrlView) with several TreeViewCtrls =
installed. Depending on the Tab chosen, the appropriate tree view shows =
and the others are hidden, kind of like the vc++ ide. So far, so good.

My problem is entirely cosmetic. I'm getting a flash every time a node =
expands on the tree view. I think it's because the background of the =
treeview control is white and it's sitting on top of a gray tab view.

The documentation says I can change the color of the tab view using =
SetBkColor (a kludge at best) but this documented method doesn't exist =
as far as I can discover.=20

I'd like to get rid of the flashing, it makes the application look =
something less than solid. Can anyone lead me in the right direction?

Thanks,
Jim Leavitt=20




Roger Lamb RAS+ 95 -- rasplus@lambsoftware.com
Monday, January 29, 1996

[Mini-digest: 2 responses]


At 10:32 PM 1/28/96 -0800, you wrote:
>Hi...
>I've got a problem I know someone out there has solved, and I'm tired of
digging around for the solution! I'm using VC4 under Windows 95.
>
>My problem is entirely cosmetic. I'm getting a flash every time a node
expands on the tree view. I think it's because the background of the
treeview control is white and it's sitting on top of a gray tab view.

Have you tried stopping the redraw of the Parent to your CTreeCtrl?

Add the following handler to stop any painting of the Parent to you CtreeCtrl:

BOOL CYourTabView::OnEraseBkgnd(CDC* pDC) 
{
        return TRUE;    // TRUE means you are filling in the background,
gets rid of flash
}

Sincerely,
Roger C. Lamb Jr.

Lamb Software Inc.
Email: rasplus@lambsoftware.com
Upates: http://www.lambsoftware.com

-----From: nicolas@dsys.ceng.cea.fr


Jim Leavitt  wrote:

>My problem is entirely cosmetic. I'm getting a flash every time a node =
>expands on the tree view. I think it's because the background of the =
>treeview control is white and it's sitting on top of a gray tab view.

I think you must override OnEraseBackground() and simply do nothing in it.
Doing that you prevent MFC to clear a white background before drawing your
TreeView control.

Eric Nicolas .




| Вернуться в корень Архива |