Questions tagged [dockpanel]

Defines an area where you can arrange child elements either horizontally or vertically, relative to each other.

Defines an area where you can arrange child elements either horizontally or vertically, relative to each other.

224 questions
406
votes
4 answers

How to get StackPanel's children to fill maximum space downward?

I simply want flowing text on the left, and a help box on the right. The help box should extend all the way to the bottom. If you take out the outer StackPanel below it works great. But for reasons of layout (I'm inserting UserControls dynamically)…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
58
votes
1 answer

What is the difference between a StackPanel and DockPanel in WPF?

What can a DockPanel do that a StackPanel cannot? If anyone has an image of something that can be achieved with a StackPanel, but not a DockPanel, than that would be great.
Casebash
  • 114,675
  • 90
  • 247
  • 350
45
votes
2 answers

WPF: How can I stretch the middle child in a DockPanel?

I added a DockPanel to a RadioButton element such that I can distribute the radio button label, a textbox and a button horizontally using 100% of the width. Using LastChildFill="True"within the DockPanel stretches the last element. This works out…
brgn
  • 1,165
  • 1
  • 9
  • 19
39
votes
4 answers

How programmatically dock new element to DockPanel

How programmatically create an element based on UserControl and dock it to the DockPanel?
iLemming
  • 34,477
  • 60
  • 195
  • 309
37
votes
2 answers

WPF Dockpanel first child uses remaining space

In a window I have there is a list of DockPanels to specify a couple of files. Each DockPanel has a TextBox (for the path) and a button (to browse for a file). I've recreated a simple WPF page to demostrate the problem here:
Mizipzor
  • 51,151
  • 22
  • 97
  • 138
24
votes
3 answers

How to make DockPanel fill available space

I'm trying the content of a shopping cart in an ItemsControl(ListBox). To do so, I've created the following DataTemplate:
Richard McGuire
  • 10,780
  • 8
  • 31
  • 34
18
votes
3 answers

DockPanel Tab Order

I have a DockPanel set up in the DataTemplate of an ItemsControl as below:
NickAldwin
  • 11,584
  • 12
  • 52
  • 67
17
votes
6 answers

C# WPF how to set location,width and height of the controls programmatically?

I'm doing my first WPF application. im having problem whereby when my form is maximized or fullscreen, my controls wont resize and just stay in the same location. only the form is maximized. in winform, I can do the adjustment in the .cs like the…
Psychocryo
  • 2,103
  • 8
  • 26
  • 33
16
votes
1 answer

Why does DockPanel.Dock="Bottom" put element at the top?

The following code puts the two text elements at the top even though the second one is marked "Bottom". The background color goes all the way to the bottom so the DockPanel seems to stretch to the bottom. What am I not understanding about…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
15
votes
3 answers

Spacing buttons equally across a window in WPF

What's the best control to arrange buttons horizontally across a window in WPF? I am having trouble arranging the buttons evenly while resizing the window. I tried to use the stack panel but the buttons just stay at their position and do not space…
Saurabh Lalwani
  • 705
  • 2
  • 7
  • 15
14
votes
2 answers

How can I get Silverlight 4 Tools to work in Web Developer 2010 Express?

I installed Windows 7. I then installed Web Developer 2010 Express from here with the Web Platform Installer. I then installed the the April 15 release of Silverlight 4 Toolkit from here. I then added this reference: alt text…
13
votes
3 answers

How to make items in a DockPanel expand to fit all available space in WPF?

I have a StackPanel containing a StackPanel and some other items. The first StackPanel has a vertical orientation, the the inner one has a horizontal orientation. The inner one has a TreeView and a ListView, I would like them to expand and fit the…
LM.
  • 1,625
  • 3
  • 16
  • 23
11
votes
4 answers

Dock Panel component for .NET that allows docking inside tab-pages?

I want to build a user-interface that, for historical reasons, has a lot of "columns" of information. Many of these aren't relevant for all users in all cases, so I thought I'd look at dock panels to allow the users to hide or rearrange the columns…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
7
votes
3 answers

WPF Dockpanel won't align right

I have this code on which I use a DockPanel on a Button.Content. However it doesn't let me right align the last image (small arrow).
PitAttack76
  • 2,120
  • 5
  • 31
  • 44
5
votes
2 answers

How to get a TextBlock to wrap text inside a DockPanel area?

What do I have to do to get the inner TextBlock below to wrap its text without defining an absolute width? I've tried Width=Auto, Stretch, TextWrapping, putting it in a StackPanel, nothing seems to work. (source: deviantsart.com)…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
1
2 3
14 15