K
K
kykyryky2015-08-07 12:59:42
WPF
kykyryky, 2015-08-07 12:59:42

Why is textbox "clipped" horizontally?

In a WPF project, a form has a textbox with a DropShadowEffect applied. In the constructor, everything looks correct:
89fdc70de6dc4834a41bfd09aebd9aa2.jpg
But when the application starts, the component seems to be cut off on both sides:
9b03bbc2c8074a01a5d901a5ecc2dae0.jpg

<TextBox x:Name="textBox" HorizontalAlignment="Center" Height="183" TextWrapping="Wrap" VerticalAlignment="Top" Width="200" Margin="533,63,402,0" Foreground="#FF00F993" FontSize="133.333" Background="#FF32475D" BorderBrush="Red" BorderThickness="1" TextAlignment="Center" MaxLength="2" Text="4" KeyDown="textBox_KeyDown" PreviewTextInput="textBox_PreviewTextInput">
            <TextBox.Effect>
                <DropShadowEffect BlurRadius="15" ShadowDepth="10"/>
            </TextBox.Effect>
        </TextBox>

Why is this happening and what parameter is responsible for this behavior?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2015-08-21
@kykyryky

margin and width? try making the width a little smaller, and then adjust the Margin.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question