Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

How to get the "client area" of a window?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-24-2006   #1 (permalink)
fö
Guest


 

How to get the "client area" of a window?

When a window is resized the SizeChangedEventArgs only give
me the new size of the whole window including title and borders.
How do I get the width and height of what was formerly known as
"client area" of a window? In GDI the answer was given by
GetClientRect(). What's it in WPF?

My System SpecsSystem Spec
Old 02-24-2006   #2 (permalink)
Drew Marsh
Guest


 

Re: How to get the "client area" of a window?

fo wrote:

> When a window is resized the SizeChangedEventArgs only give me the new
> size of the whole window including title and borders. How do I get the
> width and height of what was formerly known as "client area" of a
> window? In GDI the answer was given by GetClientRect(). What's it in
> WPF?


You can get the ActualWidth/Height of the window's content (the root) element.

HTH,
Drew

___________________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. - http://www.mimeo.com
Microsoft C# / WPF MVP
Weblog - http://blog.hackedbrain.com/


My System SpecsSystem Spec
Old 03-01-2006   #3 (permalink)
fö
Guest


 

Re: How to get the "client area" of a window?

Well, it's just the other way around: I want to resize the
window's root element (a canvas) to its client area. So
I'd better ask how to do this.

Thanks,
fö

"Drew Marsh" wrote:

> fo wrote:
>
> > When a window is resized the SizeChangedEventArgs only give me the new
> > size of the whole window including title and borders. How do I get the
> > width and height of what was formerly known as "client area" of a
> > window? In GDI the answer was given by GetClientRect(). What's it in
> > WPF?

>
> You can get the ActualWidth/Height of the window's content (the root) element.
>
> HTH,
> Drew
>
> ___________________________________
> Drew Marsh
> Chief Software Architect
> Mimeo.com, Inc. - http://www.mimeo.com
> Microsoft C# / WPF MVP
> Weblog - http://blog.hackedbrain.com/
>
>
>

My System SpecsSystem Spec
Old 03-01-2006   #4 (permalink)
Drew Marsh
Guest


 

Re: How to get the "client area" of a window?

fö wrote:

> Well, it's just the other way around: I want to resize the window's
> root element (a canvas) to its client area. So I'd better ask how to
> do this.


Perhaps I don't undersand, this should be automatic. The Window always stretches
its content to fit the client area. Do you have a screenshot of what you're
experiencing vs. what you're expecting?

Cheers,
Drew


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not responding when closing "Local Area Connection Properties" box problem man Vista networking & sharing 0 05-22-2008 02:44 AM
Vista style status bar and preview area in "find file" window Spike Spiegel Vista General 1 04-11-2008 01:42 PM
changing the "documents" location to a network area Stevie G Vista General 1 05-25-2007 09:34 AM
Where are settings for "Confirm after download" & "in same window" Roland Vista performance & maintenance 0 12-22-2006 08:43 AM
What's "Tunnel adapter Local Area Connection" cstrike Vista networking & sharing 0 10-09-2006 05:31 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51