Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Panel contents display issue when resizing

I have a form with 4 panel controls, only one of which is visible at any time.
When I resize the main form, the panel resizes, but the form in the panel loses the visibility of the controls in the form.
They seem to flash visible, invisible, as you resize, and if you happen to stop resizing when they are invisible they don't show unless you move the mouse over the top.

I have added a SIZE event to REDRAW both the panel control and the form, but makes little difference.

Any thoughts please?



  • Colin,

    I'll have to test this myself to see what is happening. Before I do this, do you think that I need to add 4 panel controls to cause this problem or is that just additional information that is probably not relevant? Also, are you using the AddCtrls method or the SetForm method?
  • Don

    I thought I would test this before advising, to see if turning off the panels first made a difference.
    It actually turns out that I had 5 panels, one there not used, and this is what caused my issue.
    Setting all panels to invisible on form designer has resolved my issue.
    Thanks for your time anyway.

  • As I recall, OI forms do not have the WS_CLIPCHILDREN style set, so when the control erases it's background, it erases all controls. Perhaps the form is just not getting the message to fully repaint. One possibility is to force this style bit on.

    In the Form Designer, open the form and select Raw Style Bits from the Properties menu, then make sure the following check mark indicated in the attached image is on. If it's already on, then I'm not on the right track with this.
  • Looks like I was 3 minutes too late. However, you solution makes sense. When two controls occupy the same space in OI, they fight to be in front. Those times your panel appeared to not redraw was actually the 5th panel winning the fight to be in front.
Sign In or Register to comment.