sb
alielie
2025-03-03 f90615921589586c1f9efde22620b45243d94657
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<Window x:Class="Plugin.TestResult_WPF.Scanner"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Plugin.TestResult_WPF"
        WindowStartupLocation="CenterScreen"
        Closing="Window_Closing"
        mc:Ignorable="d"
        Title="{Binding title}" Height="450" Width="800">
    <Window.Resources>
        <local:FontSizeConverter x:Key="FontSizeConverter"/>
        <Style TargetType="Label">
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
Converter={StaticResource FontSizeConverter}, ConverterParameter='100,1920'}" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
Converter={StaticResource FontSizeConverter}, ConverterParameter='100,1920'}" />
        </Style>
        <Style TargetType="Button">
            <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
Converter={StaticResource FontSizeConverter}, ConverterParameter='100,1920'}" />
        </Style>
    </Window.Resources>
 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
            <!--<RowDefinition />-->
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch">请依次扫下列条码</Label>
        <Label Grid.Row="1" Grid.Column="0">储位条码</Label>
        <!--<Label Grid.Row="2" Grid.Column="0">夹具条码</Label>-->
        <Label Grid.Row="2" Grid.Column="0">产品条码</Label>
 
        <TextBox Grid.Row="1" Grid.Column="1" x:Name="positionText" TextWrapping="NoWrap"/>
        <!--<TextBox Grid.Row="2" Grid.Column="1"/>-->
        <TextBox Grid.Row="2" Grid.Column="1" x:Name="snrText"/>
 
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2">
            <Button Margin="20" Padding="15" Click="Con_Click">继续扫描</Button>
            <Button Margin="20" Padding="15" Click="Ok_Click">扫描完成</Button>
        </StackPanel>
    </Grid>
</Window>