Windows - Container Control versus Dialog Window

My app occasionally needs to popup a small window for user input. I prefer to do this with a container control that I keep invisible normally, because then all controls are in the same window and it is easier/cleaner to flow events and information between the window controls and the container controls.

I implemented this on a window that has a list box, and needed the container to overlap some of the listbox. Unfortunately - it looks like when the listbox changes/refreshes it overwrites the portion of the container that overlaps the listbox, even if the container is at a higher z-level than the listbox.

Questions:

  • Is it normally a bad strategy to use a container control the way I am suggesting above (invisible normally; visible when needed)?
  • Is this expected behavior: the listbox refresh will overwrite a portion of a container that is above but overlapping the listbox?

Well, as you’ve seen, it can lead to drawing issues when things get resized. Overlapping of controls is just bad - especially in Windows. I just wouldn’t do it that way.

What I would do is have a dynamic modal dialog that’s displayed when need it. It’s a window and you can force the user to input data before they can use the rest of the UI.

Depending on the platform there might be some differing things you can do. On the Mac you probably have 2 or 3 options (others can fill those in) but in Windows and Linux you’re kind of stuck, I think.

[quote=159244:@Bob Keeney]Well, as you’ve seen, it can lead to drawing issues when things get resized. Overlapping of controls is just bad - especially in Windows. I just wouldn’t do it that way.

What I would do is have a dynamic modal dialog that’s displayed when need it. It’s a window and you can force the user to input data before they can use the rest of the UI.

Depending on the platform there might be some differing things you can do. On the Mac you probably have 2 or 3 options (others can fill those in) but in Windows and Linux you’re kind of stuck, I think.[/quote]
Yep - that’s what I figured. I was hoping for a different answer, so thought I would pose the questions.
Thanks.

I’ve done it both ways. Windows is always going to be the problem, though. Redraw/refresh issues will always be a problem.