Reputation: 1366
Is there any way I can make a WPF TextBox dynamically grow beyond the bounds of its parent?
For example, I am allowing a user to type in an XPath string that could be very long (wide), I would like one of two possible things to happen:
Is this possible?
Upvotes: 3
Views: 818
Reputation: 7103
You can try the following:
TextBox
inside a Canvas
.TextBox
using fixed or dynamic coordinates relative to the ParentControl.TextBox
Z-Index to higher value of the ParentControl.TextBox
based on TextBox
events.Upvotes: 0
Reputation: 25563
You can set a negative Margin to allow it to grow wider than its parent.
<Grid>
<Grid Margin="50">
<TextBlock Margin="0,0,-50,0" Text="This is a very long text." />
</Grid>
</Grid>
Upvotes: 3