469,898 Members | 1,611 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

tiling windows

Hello,
I write application which displays 3 windows at the startup. Is there
any way (apart from hardcoding their location), to display them tiled (so
that they do not overlap)?

Thx

Piotrek Stachowicz
Nov 16 '05 #1
3 1304
You can do it by .NET tools only in MDI container.
If you have separate forms opened within regular enviroment you will need to
calculate their locations.
From the other habd you can prebuild screen bounds and set each one of you
windows StartPosition to WindowsDefaultBounds. Hope it'll help.

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"Piotrek Stachowicz" <dy******@poczta.onet.pl> wrote in message
news:cb**********@news.onet.pl...
Hello,
I write application which displays 3 windows at the startup. Is there
any way (apart from hardcoding their location), to display them tiled (so
that they do not overlap)?

Thx

Piotrek Stachowicz

Nov 16 '05 #2
Hi,

you could get the screen size and then calculate the position from that
point.

Snippet:

For Window #1:

Rectangle workrect = Screen.PrimaryScreen.WorkingArea;
this->Height = workrect.Height /3;
For Window #2:

Rectangle workrect = Screen.PrimaryScreen.WorkingArea;
this.Height = workrect.Height /3;
Point ptTopLeft = new Point(0,this.Height);
this.Location = ptTopLeft;
For Window #3:

Rectangle workrect = Screen.PrimaryScreen.WorkingArea;
this.Height = workrect.Height /3;
Point ptTopLeft = new Point(0,2*this.Height);
this.Location = ptTopLeft;

This should solve your problem. I'm not sure whether all the calls are
correct, since I'm coding C++ at the moment, so I might get confused,
but this is basically the way to go.

Martin

Piotrek Stachowicz wrote:
Hello,
I write application which displays 3 windows at the startup. Is there
any way (apart from hardcoding their location), to display them tiled (so
that they do not overlap)?

Thx

Piotrek Stachowicz

Nov 16 '05 #3
Tamir,mphanke:
Gosh, people, you are fast :)
Thanks

Piotrek
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jim Hubbard | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
1 post views Thread by Jim Hubbard | last post: by
3 posts views Thread by Viken Karaguesian | last post: by
reply views Thread by kirby.urner | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.