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
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
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.
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.
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 will report to Revelation, although I am on OI8, so OI9 may have resolved already.
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.