页面代码:
< Window x: Class= " WpfSnqkGasAnalysis.WindowGasExportA2" 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:WpfSnqkGasAnalysis" mc: Ignorable= " d" WindowStartupLocation = " CenterScreen" FontSize = " 16" Title = " 导出A2,自定义导出设置列" Height = " 744" Width = " 800" > < Window.Resources> < Style TargetType = " Button" x: Key= " sel_button" > <Setter Property="Margin" Value="13,2" ></Setter><Setter Property="Padding" Value="10,2" ></Setter><Setter Property="FontSize" Value="16" ></Setter><Setter Property="HorizontalContentAlignment" Value="Left" ></Setter> </ Style> < Style TargetType = " Border" x: Key= " boder_order" > <Setter Property="MinWidth" Value="233" ></Setter><!--<Setter Property="BorderBrush" Value="Lime" ></Setter><Setter Property="BorderThickness" Value="2" ></Setter>--><Setter Property="Margin" Value="20,2" ></Setter><Style.Resources><Style TargetType="Label" ><Setter Property="FontSize" Value="16" ></Setter> </ Style> < Style TargetType = " TextBox" > <Setter Property="FontSize" Value="16" ></Setter> </ Style> </ Style.Resources> </ Style> </ Window.Resources> < Grid> < Grid.RowDefinitions> < RowDefinition Height = " 70" > </ RowDefinition> < RowDefinition Height = " *" > </ RowDefinition> </ Grid.RowDefinitions> < Grid Grid.Row = " 0" > < Border BorderBrush = " Gold" BorderThickness = " 0,0,0,1" > < Grid> < Label HorizontalAlignment = " Left" Margin = " 0,0,0,0" VerticalAlignment = " Top" > 注意:请先点击左侧需要导出的字段,以作为导出列</ Label> < TextBlock HorizontalAlignment = " Left" Margin = " 70,44,0,0" TextWrapping = " Wrap" FontWeight = " Bold" Text = " 勾选导出列" VerticalAlignment = " Top" RenderTransformOrigin = " 0.952,0.48" /> < TextBlock HorizontalAlignment = " Left" Margin = " 376,44,0,0" TextWrapping = " Wrap" FontWeight = " Bold" Text = " 已勾选的导出列" VerticalAlignment = " Top" /> </ Grid> </ Border> </ Grid> < Grid Grid.Row = " 1" > < Grid ShowGridLines = " True" > < Grid.ColumnDefinitions> < ColumnDefinition Width = " 284" > </ ColumnDefinition> < ColumnDefinition Width = " *" > </ ColumnDefinition> </ Grid.ColumnDefinitions> < ScrollViewer Grid.Column = " 0" VerticalScrollBarVisibility = " Auto" > < StackPanel x: Name= " leftFields" Orientation = " Vertical" Background = " #FFFFFF" > < Button Content = " 样品编号" Tag = " k338_sample_no" Style = " { StaticResource sel_button} " /> < Button Content = " 井号" Tag = " k338_well_no" Style = " { StaticResource sel_button} " /> < Button Content = " 类别" Tag = " k338_cate" Style = "