Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » What to do instead of CExtToolControlBar::OnPaint() Collapse All
Subject Author Date
Seth Strong Jan 15, 2007 - 1:04 PM

I have a custom static control as part of a toolbar. This custom static control needs to be repainted when some options are changed. However when it (based on CStatic) Invalidate() s itself, its OnPaint never gets called. I tried trapping the OnPaint message in the owner (toolbar), but there is a comment not to call CExtToolControlBar::OnPaint and several other buttons don’t display properly.

Is there a proper way to get the custom control to repaint properly?

Technical Support Jan 16, 2007 - 3:07 AM

If your static control is HWND-based, then you should simply redraw this window:

HWND hWnd = . . .
    ::InvalidateRect( hWnd, NULL, TRUE );
    ::UpdateWindow( hWnd ); // update the screen immediately
If it is a custom toolbar button, then just invoke the CExtBarButton::RedrawButton() method instead.