I have a winform within a remote desktop application that is built dynamically with a container panel for a toolbar with large (regular) buttons. The application is writen in C# and .NET 4.0. The application is viewed as it should only if I do not maximize the window (meaning restored view is fine).
Now, after RDP login – within most client computers – the application looks fine (even when we maximize and restoring). Within low resolution client computers (800×600), the buttons on the toolbar are not displayed in the right position (such as in the 1024×768 clients).
I used double buffering and it didn’t help… the problem may or may not be depended on the screen resolution (it can be memory issue or something). It is not a problem of localization layout.
The following image shows the Fine and Bad states: https://i.stack.imgur.com/fPHD9.jpg
What can I do to resolve this issue?
OK, so in case anybody gets to this kind of case, this is the thing that made the issue:
In the form, there was an empty repaint override. The programmer that created the form was overriding the repaint with an empty method (don’t know why, I guess I’ll ask my team for the business logic).
How did I reproduce it in the development environment? Following Albin Sunnanbo’s note, I ran the RDP application in minimized version during initialization, and I noticed that it occurs with large resolution clients also in this use case… So, I know repaint occurs while performing a window resize – and this made me suspicious about the method…
==> On a side note, I guess this is why inheritance is so bad, and going on to WPF is better. It took me 3 days to understand why this issue occurred.