Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
OI10 & Tab Control
I recently added an SRP Tab control to an existing form in OI9 as I have done many times before. All works as expected. As this form has been around forever, there are several OI buttons with images in the old toolbar fashion.
No real problem with that until, the form was migrated to OI10.
With the tab control added, the OI buttons no longer display the images at runtime. They do display them in the OI10 form designer but at runtime, no images.
Remove the tab control and the buttons return to displaying as they should.
Changing the buttons to SRP buttons, (which do behave correctly), is a nice idea but not a realistic endeavour.
Too many buttons on too many forms.
No real problem with that until, the form was migrated to OI10.
With the tab control added, the OI buttons no longer display the images at runtime. They do display them in the OI10 form designer but at runtime, no images.
Remove the tab control and the buttons return to displaying as they should.
Changing the buttons to SRP buttons, (which do behave correctly), is a nice idea but not a realistic endeavour.
Too many buttons on too many forms.
Comments
For now, the work around is to not set the AllowXPTheme property at all, even if you are currently setting it to 0.
Will be keen to hear of a resolution when you come up with one though.
This is how SRP Tab knows to leave a bitmap button alone. If it sees the BS_OWNERDRAW flag, it ignores the button when it subclasses other controls on the form.
OI 10 no longer uses this technique, so the SRP Tab has no way whatsoever to distinguish between bitmap buttons and regular buttons. Moreover, SRP Tab doesn't have access to the presentation server, so it cannot access OI specific settings or the button's image. Thus, we are in an all-or-nothing situation. If you want to preserve the old bitmap buttons, you'll need to avoid setting the AllowXPTheme property at all, which means other controls will look funky when place within the SRP Tab pane.
It would seem the path of least resistance would be to upgrade your buttons to OI 10 buttons or SRP Buttons.
This is one of several reasons why moving to OI 10 is a port, not an upgrade.
Thanks for looking into it Kev.
We'll change the buttons to SRP buttons wherever we've implemented the SRP tab.
Looking at it from that perspective, it's not as big a job as first perceived.
We'll just now know that moving forward, if we switch an OI "Tab" to the SRP tabcontrol, it will include the changing of the buttons as well. Switching the tabs was a relatively quick way to improve overall appearance. Will still follow that path but will likely be a little more selective as to when.
The scenario is, we're still developing in OI9 and then periodically porting to OI10 so that when we're ready, we're ready.
Changing to SRP buttons in OI9 means doing it once. Changing to OI10 buttons means redoing it everytime we recreate the OI10 environment.
Changing to SRP buttons in OI9 means doing it once. Changing to OI10 buttons means redoing it everytime we recreate the OI10 environment.
Ah, yes, that makes sense.
We always suspected the SRP Tab would be problematic in OI 10. SRP Tab was the second control ever created, back in OI 4.x, and it does a ton of hooking, clipping, subclassing, and custom drawing to make the effect work. Since OI 10 has a new composition-based presentation server, it's likely all those smoke-and-mirrors are causing havoc.
OI 10 has improved its controls a lot. We do recommend using them whenever possible. I figure the future of SRP Controls will be specialty controls.
OI 10 really is a different beast. Moving from OI 9 to OI 10 is more akin to moving from AREV to OI.