Page 1 of 1

[SOLVED] textbox with fixed size and with BorderThickness is not true position?

Posted: Sun Feb 18, 2018 12:34 am
by hamishebahar
Hi,
I'm testing to create a text box and textblock fixed size in my view page,but there is problem for rendering TextBoxes.I set fixed size for my textboxes and texblocks but texboxes are bigger than textbocks and I found that problem is for BorderThickness property of textbox,when i set BorderThickness="0" this will fixed problem.

here is my xaml example:

Code: Select all

 <Grid Grid.Row="1" x:Name="gridAddEmployee" Visibility="Collapsed" Margin="0,10,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <StackPanel >
                    <TextBlock Height="25" Background="red" Margin="0,0,0,0" Text="نام و نام خانوادگی:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="شماره تلفن:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="نام کاربری:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="کلمه ی عبور:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="نام و نام خانوادگی:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="شماره تلفن:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="نام کاربری:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                    <TextBlock Height="25" Background="red" Margin="0,10,0,0" Text="کلمه ی عبور:" HorizontalAlignment="Right" VerticalContentAlignment="Center"/>
                </StackPanel>

                <StackPanel  Grid.Column="1" Margin="0,0,10,0" Width="200">
                    <TextBox Height="25" Background="red" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                    <TextBox Height="25" Background="red" Margin="0,10,0,0" />
                </StackPanel>
                <StackPanel Grid.Column="2">
                    <CheckBox  Height="25" VerticalContentAlignment="Center" Content="فعال/غیر فعال"/>
                    <TextBlock Height="25" Margin="0,10,0,0" VerticalContentAlignment="Center" Text="جنسیت"/>
                    <TextBlock Height="25" Margin="0,10,0,0" Text="توضیحات:" VerticalContentAlignment="Center"/>
                </StackPanel>
                <StackPanel  Grid.Column="3" Width="200">
                    <Grid Height="25"/>
                    <TextBox VerticalAlignment="Center" Margin="0,10,0,0" Text="" Height="50"/>
                    <ComboBox Margin="0,10,0,0" Height="25" VerticalAlignment="Center"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Row="1">
                    <Button x:Name="btnAddEmployeeSave" Click="btnAddEmployeeSave_Click" Content="ذخیره"/>
                    <Button x:Name="btnCancelAddEmployee" Click="btnCancelAddEmployee_Click" Content="انصراف"/>
                </StackPanel>
            </Grid>

Untitled.png
Untitled.png (18 KiB) Viewed 5744 times

Re: textbox with fixed size and with BorderThickness is not true position?

Posted: Mon Feb 19, 2018 1:09 am
by JS-Support @Userware
Hi,

Thanks for reporting this issue. We are going to look into it and keep you updated.

Regards,
JS-Support

Re: textbox with fixed size and with BorderThickness is not true position?

Posted: Fri Mar 09, 2018 5:20 am
by JS-Support @Userware
Hi,

We have fixed this issue. The fix is available in v1.1 Beta1 and newer, which you can download from:
http://forums.cshtml5.com/viewforum.php?f=6

Thanks.
Regards,
JS-Support