S
S
Semyon Novikov2018-04-15 20:32:32
WPF
Semyon Novikov, 2018-04-15 20:32:32

How to do scaling in WPF?

How to scale rich text when expanding/collapsing a form to the right and bottom side. I'm using Canvas to lay out elements. Or is this not possible with Canvas?

<Window
         ....

        Title="MainWindow" Height="450" Width="800"
        TextElement.Foreground="{DynamicResource MaterialDesignBody}"
        TextElement.FontWeight="Regular"
        TextElement.FontSize="13"
        TextOptions.TextFormattingMode="Ideal" 
        TextOptions.TextRenderingMode="Auto"        
        Background="{DynamicResource MaterialDesignPaper}"
        FontFamily="{DynamicResource MaterialDesignFont}">

    <dragablz:TabablzControl FixedHeaderCount="3">
        <dragablz:TabablzControl.InterTabController>
            <dragablz:InterTabController />
        </dragablz:TabablzControl.InterTabController>
        <TabItem Header="Заметки">

            <Grid>
                <Canvas Background="White"> 
                    <Button x:Name="Save"  Content="Сохранить" IsDefault="True" Click="btn_save_Click" Canvas.Top="10" Canvas.Left="5"  />
                    <Button x:Name="Open"  Content="Открыть" IsDefault="True" Click="btn_open_Click" Canvas.Top="10" Canvas.Left="125"   />
                    <RichTextBox x:Name="richtxt_main" Width="780" Height="320" Canvas.Top="50" Canvas.Left="2"  />
                </Canvas>
            </Grid>
        </TabItem>
        <TabItem Header="Защищённые заметки">
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">Скоро!</TextBlock>
        </TabItem>
        <TabItem Header="Настройки">
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">Скоро!</TextBlock>
        </TabItem>
    </dragablz:TabablzControl>
</Window>

5ad38c0e942a7437370152.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Yudakov, 2018-04-15
@semennovikov123

https://metanit.com/sharp/wpf/4.5.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question