Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WPF DockPanel positioning

8 views
Skip to first unread message

tshad

unread,
Jan 4, 2010, 11:17:40 AM1/4/10
to
I was curious as to why in a DockPanel, if you set DockPanel.Dock="Left" -
it puts the object in the middle???

For example, I have 2 objects and one is .Dock="Top" and another that has
.Dock="Left". The 1st object is correctly at the top, but the next object
ends up in the middle.

<Window x:Class="FontViewer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Font Viewer" Height="480" Width="600">
<DockPanel>
<Border DockPanel.Dock="Top"
CornerRadius="6"
BorderThickness="1"
BorderBrush="Gray"
Background="LightGray"
Padding="8"
Margin="0 0 0 8">
<TextBlock FontSize="14"
TextWrapping="Wrap">
Select a font to view from the list below.
You can change the text by typing in the region at the
bottom
</TextBlock>
</Border>
<ListBox x:Name="FontList"
DockPanel.Dock="Left"
ItemsSource="{x:Static Fonts.SystemFontFamilies}"
Width="160" />

</DockPanel>
</Window>

If I add a TextBlock with a DockPanel.Dock="Bottom", it doesn't go to the
bottom but to the right of the ListBox????

<Window x:Class="FontViewer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Font Viewer" Height="480" Width="600">
<DockPanel>
<Border DockPanel.Dock="Top"
CornerRadius="6"
BorderThickness="1"
BorderBrush="Gray"
Background="LightGray"
Padding="8"
Margin="0 0 0 8">
<TextBlock FontSize="14"
TextWrapping="Wrap">
Select a font to view from the list below.
You can change the text by typing in the region at the
bottom
</TextBlock>
</Border>
<ListBox x:Name="FontList"
DockPanel.Dock="Left"
ItemsSource="{x:Static Fonts.SystemFontFamilies}"
Width="160" />
<TextBox x:Name="SampleText"
DockPanel.Dock="Bottom"
MinLines="4"
Margin="8 0"
TextWrapping="Wrap"
ToolTip="Type here to change the preview text.">

</TextBox>
</DockPanel>
</Window>

Thanks,

Tom


Olaf Rabbachin

unread,
Jan 5, 2010, 7:45:17 AM1/5/10
to
Hi tshad,

> I was curious as to why in a DockPanel, if you set DockPanel.Dock="Left" -
> it puts the object in the middle???
>
> For example, I have 2 objects and one is .Dock="Top" and another that has
> .Dock="Left". The 1st object is correctly at the top, but the next object
> ends up in the middle.

that's because the DockPanel uses the last element to fill the window by
default. Adding a ...
LastChildFill="False"
... to the DP's properties will disable that behaviour.

BTW - this (an ASP.Net NG) is not the right place for WPF questions. You
might want to go to the WPF-forums:
http://social.msdn.microsoft.com/Forums/en-US/wpf/threads

Cheers,
Olaf

tshad

unread,
Jan 7, 2010, 11:00:09 AM1/7/10
to
"Olaf Rabbachin" <Olaf_...@IntuiDev.com> wrote in message
news:uFF3vTgj...@TK2MSFTNGP06.phx.gbl...

I couldn't find a newsgroup for WPF before.

I normally use msnew.microsoft.com but there doesn't seem to be a newsgroup
for wpf there.

They are normally microsoft.public.x and the closest I could find was
microsoft.public.dotnet.framework.aspnet.

Thanks,

Tom

> Cheers,
> Olaf


Olaf Rabbachin

unread,
Jan 8, 2010, 3:27:53 PM1/8/10
to
Hi Tom,

tshad wrote:

> I couldn't find a newsgroup for WPF before.
>
> I normally use msnew.microsoft.com but there doesn't seem to be a newsgroup
> for wpf there.
>
> They are normally microsoft.public.x and the closest I could find was
> microsoft.public.dotnet.framework.aspnet.

it seems that MS is sort of abandoning the NNTP-newsgroups. You won't find
any related to the "newer" technologies, hence you'll probably be bound to
use the forums instead. A shame, if you ask me.

Cheers,
Olaf

tshad

unread,
Jan 10, 2010, 4:38:23 PM1/10/10
to

"Olaf Rabbachin" <Olaf_...@IntuiDev.com> wrote in message
news:eG$UOEKkK...@TK2MSFTNGP02.phx.gbl...

I agree.

I have a problem with the forums because I can't remember which ones I am on
and I usually access them from different locations. I usually use outlook
express to access them and I can go directly to msnew.microsoft.com to see
all my messages.

Thanks,

Tom

>
> Cheers,
> Olaf


Olaf Rabbachin

unread,
Jan 13, 2010, 5:07:58 AM1/13/10
to
Hi Tom,

tshad wrote:

> I have a problem with the forums because I can't remember which ones I am on
> and I usually access them from different locations. I usually use outlook
> express to access them and I can go directly to msnew.microsoft.com to see
> all my messages.

FWIW - the forums support the so-called "NNTP Bridge". When logged in,
click the "My Settings" link on the top right. I haven't tried it out, but
maybe it's what you're after?

From the Forums FAQ:

--- 8< ---
The NNTP Bridge Client application allows a user to configure their NNTP
Reader to read and post to the forums. Users can install the client bridge
at the Online Forums Connection. To use the bridge users must first select
"Use NNTP Bridge" in the My Settings page. Note: at this time, there are no
plans to localize the support documentation for the tool but the tool
should work any locale forum. Users can visit the Online Forums Connection
for more information, bug status and to report issues or suggestions.
--- 8< ---

Cheers,
Olaf

0 new messages