Xaml code behind the controls of position adjustment

Reception Code

<Grid Margin="-20 0 0 0" >
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="130"/>
        <ColumnDefinition Width="100"/>
        <ColumnDefinition Width="100"/>
    </Grid.ColumnDefinitions>
    <Label Grid.Column="0" Margin="-15 0 0 0" Content="提醒时限" ContentStringFormat="{}{0}:" Style="{StaticResource LableEditStyle}"/>
    <dxe:TextEdit x:Name="txtConTxsx" Grid.Column="1"  Width="98" Margin="-20 0 0 0" HorizontalAlignment="Left" Style="{StaticResource TextEditCommonStyle}"
                                                      Mask=" \+?[0-9]\d*" MaskType="RegEx" LostFocus="txtConTxsx_LostFocus"/>
    <ComboBox x:Name="cb_unit_txsx" Grid.Column="2"  Width="98" Height="23" Margin="-20 0 0 0" FontSize="14" 
                                                              VerticalAlignment="Center" HorizontalAlignment="Left" SelectedIndex="0">
        <ComboBoxItem></ComboBoxItem>
        <ComboBoxItem></ComboBoxItem>
        <ComboBoxItem>每周</ComboBoxItem>
    </ComboBox>
</Grid>
View Code

Background code

txtConTxsx.SetValue (Grid.ColumnProperty, 2 ); // set to a corresponding column Grid 
cb_unit_txsx.SetValue (Grid.ColumnProperty, . 1 ); // set to a corresponding column Grid
View Code

 

Guess you like

Origin www.cnblogs.com/rongxiaoya/p/10983833.html