![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Textbox AutoSize? Hi, I have a Grid with this code in it: <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="100" Width="100"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> In the second column lies a text box. Q: How can I fill the second column with the Textbox? When I put TextBox->Width="Auto" And TextBox->HorizontalAlignment="Stretch" I just get a huge TextBox because it is adjusted based on the Text inside the TextBox... I am new in this, so please give me smt. Even a whole new approach would be fine. I just want it to work. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Textbox AutoSize? Do you mean to have the TextBox with normal height, not filling the whole grid row? If so, then you can just set the proper height for the TextBox or host the TextBox in another parent container like StackPanel: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="100" Width="100"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBox Grid.Column="1" Grid.Row="0" Width="Auto" HorizontalAlignment="Stretch"/> <TextBox Grid.Column="1" Grid.Row="1" Height="22" Width="Auto" HorizontalAlignment="Stretch"/> <StackPanel Grid.Column="1" Grid.Row="2"> <TextBox Width="Auto" HorizontalAlignment="Stretch"/> </StackPanel> </Grid> The first TextBox will fill the first row of the grid, the second will have the set height, and the third will have normal height because it is hosted in the StackPanel. HTH, Plamen Ratchev http://www.SQLStudio.com |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| split textbox | VB Script | |||
| no textbox for password | Vista account administration | |||
| "Format-Table -autosize" as default | PowerShell | |||