![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Plug a cable into network adaptor "Local Area Connection"?? | .NET General | |||
| Plug a cable into network adapter "local area connection" | Network & Sharing | |||
| Shortcut changes when changing attribute from "Normal window" to "Maximized" | Vista General | |||
| Vista style status bar and preview area in "find file" window | Vista General | |||
| Where are settings for "Confirm after download" & "in same window" | Vista performance & maintenance | |||