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

Buttons moving

I have some buttons which I am adding in a toolbar.
They are positioned and sized based on content and caption.

I am finding that when I resize the form, the buttons reposition themselves back to the original position as per Form Designer.

The code does:
- sets the button positions, captions etc
- sizes the window centrally
- makes the window visible

This causes the buttons to look fine until you resize the form.

If I change to set the button positions, etc after the window is sized and visible, then all works fine, the buttons stay put.

Please advise if you can replicate and if any solution.
I would prefer to position the buttons before making the screen visible, to avoid the controls making themselves move about the screen for the brief monent that this takes.

Let me know if you need further info.

Colin

Comments

  • Colin,

    I have seen this behavior frequently, but not just with the SRP Button control. Just for experimental purposes, can you replace one of the controls with a standard OI control? Position, size, and name the control exactly the same way. This way your code will behave the same. Let us know if you see the same behavior affecting the OI control.
  • This is an OI caching issue. In all my tools, like SRP Editor, I have significant amounts of code to deal with this. I usually have to maintain my own cache of control sizes so I can reset the SIZE properties during the SIZE event of a form. It doesn't always happen to all controls, but it does happen to me.

    So, the good news is that you are not doing anything wrong. The bad news is that you have to add code to compensate for this anomaly.
  • Sorry about the confusion there.
    I tried an OLE control, not SRP, and a standard button control, and both show the same resize behaviour.
    I wrongly assumed it was an SRP issue, as my previous toolbar code using OI buttons did not show this, but there may have been code to deal with this.

    Its a bit of a nuisance, and I will deal with it... somehow.

    Thanks for your time.
    Colin
  • I have now changed my code to deal with this on the Resize, and all is OK.
    I will report to Revelation, although I am on OI8, so OI9 may have resolved already.
  • Colin,

    This problem still persists in OI 9, so I would encourage you to report this to Revelation. Hopefully Carl Pates can get a solution in for OI 10.
Sign In or Register to comment.