KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
So I'm coming at WPF from a HTML perspective. I just want to put a TextBox on my Window like this: <Grid> <TextBox Name="theName" /> </Grid> Turns out that the TextBox is then HUGE, covers the whole window. (!) Ok, that's not what I want, but I don't want to define the EXACT size either since I know Height and Width should be flexible, so I try: <TextBox Name="theName" Width="Auto" Height="Auto"/> Same thing. So I try: <TextBox Name="theName" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> Same thing. So I just hard code the sizes: <TextBox Name="theName" Width="100" Height="20"/> Which I know is not a good programming practice in WPF. So, what how do you tell TextBox to "display default sizes for the font size being used"?
Tags (comma-separated)
Save Edits
Cancel