I've had two (well, more then THAT, but I worked around the others) problems using rebar controls. 1) Occasionally, they don't repaint their child controls, mostly after a resize event (where I knudge em all around) 2) I would like to delete the children in a rebar. No problem as long as I leave one behind, but the LAST one out always leaves the bar the same saze, and I would like it to size to zero (well, leave it's one border as a freesh-no controls added one will do) Anyone know or have a good reference?
Posted on 2001-01-27 19:21:00 by Ernie
Hey Ernie, In my use of the ReBar control I was painting many things manually on my window. The reason the rebar control won't update is when it's been erased (WM_ERASEBKG I think) but is still considered valid. I used an API called InvalidateRect which will force a window to completely repaint. Now after doing this is usually works, however I also had some custom stuff going on in my toolbars and such, so I had to do something funny in the repaint of the main window. On WM_PAINT I retrieve the rect of the window, subtract the status bar from the bottom of the rect, subtract the rebar control from the top of the rect and then invalidate that rect. This way the window only repainted the inside client area of the window. Anyhow that's what I did, might not be totally professional, but it worked. The other option is to subclass the ReBar control and then on WM_PAINT for it, you would have to enumerate all child windows and force them all to repaint. But that sounded harder for me at the time. Hope this helps some! See ya, Ben
Posted on 2001-01-27 22:04:00 by cyberben