Search code examples
c#.netwindowsvb.net

How can I tile horizontally certain windows programmatically?


In Windows 10, when I set an window on one side of the screen, I can choose which window to fix on the other side of the screen, and when I change the size of the first window, the window next to it changes simultaneously.

By the SetWindowPos function I can arrange a window next to a window, but my question Is there any programmatic way that when the user resizes the window that the second window will also change accordingly?


Solution

  • Follow these steps:

    1. Set the first window as foreground
    2. send Windows key + left arrow
    3. Set the second window as foreground
    4. send Windows key + right arrow