English 中文(简体)
纽芬兰文
原标题:Text on button disapear
  • 时间:2024-02-06 14:15:50
  •  标签:
  • c#
  • uwp

我对我顿的案文有问题,当时我把窗户缩小,案文消失。 我想使窗户缩小,但即使纽托邦缩小,仍然看着案文。 我的法典

<Page
    x:Class="Labb_2_Calculator.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Labb_2_Calculator"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid Background="WhiteSmoke" KeyDown="Grid_KeyDown">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBox Background="White" Foreground="Black" IsReadOnly="True" Name="TextResault" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Height="160" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="1420" Margin="10" FontSize="100" Text="0"></TextBox>
        <TextBlock Foreground="Black" Name="TextNumber" TextTrimming="CharacterEllipsis" Width="Auto" Height="Auto"  Grid.Column="3" Text="" FontSize="80" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30"></TextBlock>
        <Button Name="button1" Click="Button_Click" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="1" FontSize="120">1</Button>
        <Button Click="Button_Click_1" Grid.Column="1" Background="LightGray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10" Grid.Row="1" FontSize="120">2</Button>
        <Button Click="Button_Click_2" Grid.Column="2" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="1" FontSize="120">3</Button>
        <Button Click="Button_Click_3" Grid.Column="3" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="1" FontSize="120">+</Button>
        <Button Click="Button_Click_4" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="2" FontSize="120">4</Button>
        <Button Click="Button_Click_5" Grid.Column="1" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="2" FontSize="120">5</Button>
        <Button Click="Button_Click_6" Grid.Column="2" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="2" FontSize="120">6</Button>
        <Button Click="Button_Click_7" Grid.Column="4" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="2" FontSize="120">-</Button>
        <Button Click="Button_Click_8" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="3" FontSize="120">7</Button>
        <Button Click="Button_Click_9" Grid.Column="1" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="3" FontSize="120">8</Button>
        <Button Click="Button_Click_10" Grid.Column="2" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="3" FontSize="120">9</Button>
        <Button Click="Button_Click_11" Grid.Column="3" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="3" FontSize="120">X</Button>
        <Button Click="Button_Click_12" Background="orange" HorizontalAlignment="Stretch" Margin="10" Grid.Row="4" FontSize="120" >C</Button>
        <Button Click="Button_Click_13" Grid.Column="1" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="4" FontSize="120">0</Button>
        <Button Click="Button_Click_14" Grid.Column="2" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="4" FontSize="120" >=</Button>
        <Button Click="Button_Click_15" Grid.Column="3" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="4" FontSize="120">/</Button>
    </Grid>
</Page>

我曾尝试过像高温和低温等反应性体,但至今没有工作。

问题回答

如果 but子太小,那么该纽子的原样就应该缩小,缩小范围:

<Button Click="Button_Click_1" Name="button1" Background="LightGray" HorizontalAlignment="Stretch" Margin="10" Grid.Row="1" FontSize="120">
    <Button.ContentTemplate>
        <DataTemplate>
            <Viewbox>
                <TextBlock>1</TextBlock>
            </Viewbox>
        </DataTemplate>
    </Button.ContentTemplate>
</Button>

仅将内容模板编码添加到每个县,并以正确的代码取代数字。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签