Winforms application shows differently on different computers when using Infragistics components and resizing routines
I am developing a GUI using Winforms. Everything looks fine on the majority of testing computers (as in, the UI is displayed in the same way and accordingly to the pc on which the GUI was developed). On a single laptop, though, it happens that several elements are not displayed correctly (wrong sizes, or problems in redrawing).
I am running out of tests to figure out what could possibly we wrong; all the computers run Windows 7 on various screen resolutions.
I am using Infragistics components to build the UI. Any thoughts?
edit: some examples. On the "broken" laptop, some tabs (part of an UltraWinTab) are invalidated and not redra开发者_运维技巧wn after a minimize/restore command, you get only the background of the tab but no components.
Some other controls are inexplicably drawn at a much smaller size (instead of filling the area, I get big empty bottom and right bands).
We've had issues with this as well. A Windows.Forms application with Infragistics controls looked good on Windows XP, but on W7 all kinds of resizing issues started to occur. It took me ages to find out what happened.
Of course, first I assumed it had to do with Infragistics, but I just didn't find a clue anywhere on any forum. At last I stumbled upon this link, where it was explained that beyond a certain nesting hierarchy of controls, resizing events are no longer fired.
We have a UI framework and for us it was sufficient to make a derivative of System.Windows.Forms.SplitContainer
with this override:
// HACK: under Windows7, controls do not always redraw to their whole rectangle after restoring their size.
protected override void OnSizeChanged(EventArgs e)
{
if (Handle != null) // Can be null because the event is invoked before the handle is created.
BeginInvoke((MethodInvoker)(() => base.OnSizeChanged(e)));
}
Because we have Infragistics controls (grid, dock manager) on SplitContainers. Maybe Infragistics controls have a deep nesting level, making this happen sooner than with other controls.
精彩评论