Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to "Tile" an array of window elements

I have been trying to find a way to "tile" an array of windows based on the screen resolution and just can't figure it out.  

Thus far I have put the following together. The example below uses notepad.exe, but my use case is a different application.  
using System.Windows;
using System.Collections.Generic;

var r = screen.primary.Rect;


var windows = wnd.findAll(cn: "Notepad", of: "notepad.exe");

var count = windows.Length;

int width = r.Width/count;;

int height = r.Height/count;;
int x = 0;
int y = 10;

for (int i = 0; i < count; i++) {[i]);
x = x + ???;
y = y + ???;
If anyone has so input on this I would be very thankful Smile
Do you want them to tile vertically?    If you try to tile in the classic Windows 3.1 way where you end up with a grid, you might need to set constraints on the number of rows and/or columns.  It's not quite a simple thing, but can be accomplished through some math.  I can work with you on it and we can reply to the thread with one solution we came up with.

Forum Jump:

Users browsing this thread: 1 Guest(s)