473,883 Members | 3,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WPF Fill Window

How can I make a control (panel, grid, dock) fill an entire window other
than setting height/width properties?
Nov 19 '08 #1
6 26861
Well, one way would be to add a Dockpanel to the window, and put the
content in that.

On Nov 19, 12:59*pm, Bill McCormick <wpmccorm...@ne wsgroup.nospam>
wrote:
How can I make a control (panel, grid, dock) fill an entire window other
than setting height/width properties?
Nov 19 '08 #2
Andy wrote:
Well, one way would be to add a Dockpanel to the window, and put the
content in that.

On Nov 19, 12:59 pm, Bill McCormick <wpmccorm...@ne wsgroup.nospam>
wrote:
>How can I make a control (panel, grid, dock) fill an entire window other
than setting height/width properties?
Right, that's what I'm trying to do. But what properties tell the Dock
panel to *Fill* the Window?
Nov 19 '08 #3
The DockPanel should fill the window on its own, unless you've set a
Height or Width.

Try this:

<Window x:Class="WpfApp lication9.Windo w1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<DockPanel>
<Button />
</DockPanel>
</Window>

For me, that creates a button which fills the window, even as you
resize.

On Nov 19, 3:48*pm, Bill McCormick <wpmccorm...@ne wsgroup.nospam>
wrote:
Right, that's what I'm trying to do. But what properties tell the Dock
panel to *Fill* the Window?
Nov 19 '08 #4
<Window x:Class="WpfApp lication1.Windo w1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
Title="ScTech" Height="300" Width="300">
<DockPanel Name="dockPanel 1" HorizontalAlign ment="Center"
VerticalAlignme nt="Center" Background="Ali ceBlue"
Grid.IsSharedSi zeScope="False" >
<Button/>
</DockPanel>
</Window>

Produces a tiny little button. Maybe I'm looking for something that
doesn't exist in WPF because it's not necessary?

Andy wrote:
The DockPanel should fill the window on its own, unless you've set a
Height or Width.

Try this:

<Window x:Class="WpfApp lication9.Windo w1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<DockPanel>
<Button />
</DockPanel>
</Window>

For me, that creates a button which fills the window, even as you
resize.

On Nov 19, 3:48 pm, Bill McCormick <wpmccorm...@ne wsgroup.nospam>
wrote:
>Right, that's what I'm trying to do. But what properties tell the Dock
panel to *Fill* the Window?
Nov 19 '08 #5
I'd axe all the properties you set on the DockPanel, except for the
Name. At the very least, I don't know why you have
Grid.IsSharedSi zeScope set at all, since there's no grid on your
window.

What are you trying to do?

On Nov 19, 4:13*pm, Bill McCormick <wpmccorm...@ne wsgroup.nospam>
wrote:
<Window x:Class="WpfApp lication1.Windo w1"
* * *xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
* * *xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
* * *Title="ScTech" Height="300" Width="300">
* * *<DockPanel Name="dockPanel 1" HorizontalAlign ment="Center"
VerticalAlignme nt="Center" Background="Ali ceBlue"
Grid.IsSharedSi zeScope="False" >
* * * * *<Button/>
* * *</DockPanel>
</Window>

Produces a tiny little button. Maybe I'm looking for something that
doesn't exist in WPF because it's not necessary?
Nov 19 '08 #6
Hold the phone, I got it:

<DockPanel Name="dockPanel 1" Height="Auto" Width="Auto"
LastChildFill=" False" HorizontalAlign ment="Stretch"
VerticalAlignme nt="Stretch" />

Thanks for trying.
Bill

Bill McCormick wrote:
<Window x:Class="WpfApp lication1.Windo w1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
Title="ScTech" Height="300" Width="300">
<DockPanel Name="dockPanel 1" HorizontalAlign ment="Center"
VerticalAlignme nt="Center" Background="Ali ceBlue"
Grid.IsSharedSi zeScope="False" >
<Button/>
</DockPanel>
</Window>

Produces a tiny little button. Maybe I'm looking for something that
doesn't exist in WPF because it's not necessary?

Andy wrote:
>The DockPanel should fill the window on its own, unless you've set a
Height or Width.

Try this:

<Window x:Class="WpfApp lication9.Windo w1"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<DockPanel>
<Button />
</DockPanel>
</Window>

For me, that creates a button which fills the window, even as you
resize.

On Nov 19, 3:48 pm, Bill McCormick <wpmccorm...@ne wsgroup.nospam>
wrote:
>>Right, that's what I'm trying to do. But what properties tell the Dock
panel to *Fill* the Window?
Nov 19 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
10224
by: David | last post by:
It's sad to say, but when using the AOL web site, like to send an email, they have a nifty capability such that when a window is resized, the textarea where the message is input expands not only horizontally, but also vertically, to fill the space. I took a look at their javascripts, but they are quite complex and convoluted since they make use of many of their own functions designed to work with their web site. Does anybody have a...
1
6456
by: Song Zhang | last post by:
I need to write asp/script/html code to fill the following function. 1. When a page appA.mycom.com/aa.html (aa.html code shown below) is visited from my site, a user can click the button "Launch", which launches a new window with a page from a different domain, say appB.mycom.com/bb.html. In the form myForm of aa.html, there is a field called URL. <html> <body> <form name="myForm"> <input type="button" value="Launch"...
0
3595
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars show (the Scrollregion) should expand as the window grows. It doesn't currently do this. although, if the window shrinks smaller than the...
1
12390
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars show (the Scrollregion) should expand as the window grows. It doesn't currently do this. although, if the window shrinks smaller than the original...
0
3113
by: Cc | last post by:
I try to make like note pad when open a document, the document will show in a tab control (something in vs) the trick I do is - on window container(parent) I create a split container (one for tool box ) another I put a tab control . (both set dock to fill) - on mdi child(called newDoc) I set frame to none, window state to normal. and put richtextbox in it(set dock to fill) - back to window parent on menu (just said new document ) ...
7
4526
by: Bill Nguyen | last post by:
This has been posted before but received no response: I need to arrange window screens on the total area of a mulitple-mopnitor desktop. As an example, below is the bound info for my 2-monitor PC: Device Name: \\.\DISPLAY1 Bounds: {X=1152,Y=0,Width=1152,Height=864} Primary Screen: False
4
4359
by: MichaelK | last post by:
Hello. I have all data already collected on the current page? I want to open another window with the form, fill the fields and submit that form. So basically the question is how can I fill all fields and submit the form on another window. Regards, Michael
1
3611
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading child window height is 1200px (saying), when the child window load the height of the parent window changs but the backgorund color which is given 100% not fill the parent window. I have given my example codes, please give a solution as soon as...
0
1006
by: Anish Chapagain | last post by:
Hi!! I'm trying to program an application which have multiple windows and is capable of executing method defined inside class of one another, i tries a simpel frame work here and am creating Toplevel inside method as the new window to be genereated, and again want another window to be loaded when the widget inside toplevel is executed as necessary..but am feeling lost to either create a class for such new window or write function again.....
0
9944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7977
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6005
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3241
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.