I have an ActiveForm written in Delphi 7, contained within a resizeable <object>
.
Resizing works fine, but at browser zoom levels other than 100% the form gets two resize events for every change in the browser size. The first event is for the scaled pixel size, and the second event is for the actual pixel size. This results in a very annoying flicker, as the control briefly gets redrawn at 2/3 size (say, if zoom is 150%), and then redrawn again at the correct size.
If zoom is at 100% this doesn't happen - each change in size fires a single resize event.
I have observed the same behaviour with IE8 on XP and IE11 on W7.
I am perfectly happy for zoom not to scale the actual appearance of the ActiveForm, but would like to eliminate the spurious resize event and flicker. Can this be done?
(I know it's old technology, but please don't comment just to point that out)
Edit with more information:
@SertacAkyuz - thanks for your reply and apologies for the delay following up.
You're right, TActiveForm does not get a resize event.
My main form is TMainWnd, which is subclassed from TActiveForm, IActiveFormX and IPersistPropertyBag.
It contains a TNotebook with alClient alignment.
In turn, the notebook page contains a TPanel with alClient alignment. It is to this TPanel that I have attached an OnResize handler. This handler just prepends the panel's width and height to a status bar simpletext.
e.g. with browser zoom in IE11 set to 125%, a maximise has just given me (1321,674) immediately followed by (1650,842). Similarly a restore on this occasion gave me (1022, 562) followed by (1277,702). The control briefly gets redrawn at the smaller size and then again at the larger size. This is even more noticeable when dragging the corner of the browser window, as every small change in size results in a redraw at the smaller "wrong" size followed again by a redraw at the correct size. We can live with it, but it would be nice to overcome it if possible.