AppendFromExcel.xaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <Window x:Class="MeterVision.Stand.AppendFromExcel"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:MeterVision.Stand"
  7. mc:Ignorable="d"
  8. ShowInTaskbar="False"
  9. ResizeMode="NoResize"
  10. Background="WhiteSmoke"
  11. WindowStartupLocation="CenterOwner"
  12. Title="从Excel追加数据" Height="180" Width="320">
  13. <Grid>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="*" />
  16. <RowDefinition Height="40" />
  17. </Grid.RowDefinitions>
  18. <Border Grid.Row="0" BorderBrush="#D3D3D3" BorderThickness="1" Margin="10 10 10 0" Background="White">
  19. <!-- Excel文件选择区域,初始时隐藏 -->
  20. <StackPanel Grid.Row="0" Orientation="Vertical" Margin="20,20,20,0" Visibility="Visible" x:Name="ExcelImportPanel">
  21. <TextBlock Text="请选择Excel:" HorizontalAlignment="Left" VerticalAlignment="Center"
  22. FontSize="14px" Foreground="#333333" Margin="0 0 0 5" />
  23. <Grid>
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="*"/>
  26. <ColumnDefinition Width="Auto"/>
  27. </Grid.ColumnDefinitions>
  28. <TextBox Name="txtExcelFile" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
  29. IsReadOnly="True"
  30. Foreground="#000000" Padding="2" FontSize="14px" Margin="0,0,2,0"/>
  31. <Button Name="btnImportExcel" Grid.Column="1" Content="..." Width="28" Height="26" VerticalAlignment="Center" Click="BtnImportExcel_Click" />
  32. </Grid>
  33. </StackPanel>
  34. </Border>
  35. <!-- 按钮区域 -->
  36. <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
  37. <Button Name="btnOK" Content="确定" HorizontalAlignment="Center" Margin="0 0 20 0"
  38. VerticalAlignment="Center" Width="80" Height="26" Click="BtnOK_Click" />
  39. <Button Name="btnClose" Content="取消" HorizontalAlignment="Center"
  40. VerticalAlignment="Center" Width="80" Height="26" Click="BtnClose_Click" />
  41. </StackPanel>
  42. </Grid>
  43. </Window>