0

I would like to have a wrap panel (or similar) with a bunch of names scale the text size to

  1. fill all available space (from left to right and top to bottom) the best it can
  2. when i change the size of the window the font size or whatever should increase/decrease, so it always fills the page
  3. the names should all have the same font size

Does anyone have any idea?

I tryed the following but i would manually have to set the size of the wrap pannel so it fits all the text.

<Viewbox x:Name="scaler" Stretch="UniformToFill" Width="{Binding ActualWidth, ElementName=window}">
    <WrapPanel HorizontalAlignment="Left"  x:Name="flpAnwesend" Orientation="Vertical" Height="309" Width="{Binding ActualWidth, ElementName=window}">
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <Label Content="firstname lastname"/>
        <!-- more names-->
    </WrapPanel>
</Viewbox>

EDIT: Here is what it looks like with the first comment. image

And this is what I would like it to look like. (This was done by setting the size of the warplane but I haven’t figured out a good way to do this programmatically) image

Cedric
  • 1
  • 2
  • Does this answer your question? [WPF automatic resize font until it fits within parent control](https://stackoverflow.com/questions/14881683/wpf-automatic-resize-font-until-it-fits-within-parent-control) – Orace Dec 06 '22 at 15:25
  • @Orace Sorry for the late response sadly it does not help when I do that the whole wrap panel content gets put into one vertical column, but I would like the scaling to use as many columns as needed to show all the content with the same size and make fill the page. If that makes sense. Do you have any other ideas? – Cedric Dec 12 '22 at 15:09

0 Answers0