wpf - Why does this XAML produce textboxes that resize with the window? -
I'm trying to create some round textboxes, and I've got some XAM on this site, and Works fine if I change the size of my window, either in the designer or run time, the height and width of the text box change with it, and they become distorted and useless.
I'm still learning WPF, so I'm sure I'm missing something easy thanks for any help.
& lt; Window x: name = "main window" x: class = "CMDB_Express.MainWindow" xmlns = "http://schemas.microsoft.com/winfx/2006/Jaml/Presentation" xmlns: x = "http: // schemas. Microsoft.com/winfx/2006/xaml "title =" CMDB Express "height =" 289 "width =" 600 "size syntax =" height "minhite =" 289 "& gt; & Lt; Window.Resources & gt; & Lt; ControlTemplate x: key = "textbox box control button" target type = "{x: type text boxbase}" & gt; & Lt; Border background = "{TemplateBinding Background}" x: name = "BD" borderbrush = "black" borderticiness = "{border border border}" cornerreadia = "10" & gt; & Lt; / Border & gt; & Lt; / ControlTemplate & gt; & Lt; /Window.Resources> & Lt; Grid & gt; & Lt; Name text box = "txtDOE" KeyboardNavigation.TabIndex = "0" Template = "{StaticResource TextBoxBaseControlTemplate}" Margin = "139,59,339,159" FontFamily = "Segoe UI" FONTSIZE = "18" VerticalContentAlignment = "center" MaxLength = "7 "/ & Gt; & Lt; Label x: name = "lblDOE" content = "DO number:" horizontal alignment = "left" margin = "10,72,0,0" vertical alignment = "top" fontfamily = "segoyi UI" height = "33" fontisiz = "18" /> & Lt; Name text box = "txtCustodian" KeyboardNavigation.TabIndex = "1" template = "{StaticResource TextBoxBaseControlTemplate}" Margin = "139,121,339,97" FontFamily = "Segoe UI" FONTSIZE = "16" VerticalContentAlignment = "center" / & gt; & Lt; Label X: name = "lblCustodian" content = "custodian:" HorizontalAlignment = "left" margin = "35,134,0,0" VerticalAlignment = "top" FontFamily = "Segoe UI" height = "33" FONTSIZE = "18" / & Gt; & Lt; Name text box = "txtBuilding" KeyboardNavigation.TabIndex = "2" Template = "{StaticResource TextBoxBaseControlTemplate}" Margin = "396,59,75,159" FontFamily = "Segoe UI" FONTSIZE = "16" VerticalContentAlignment = "center" / Gt; & Lt; Label x: name = "lbl building" content = "building:" horizontal alignment = "left" margin = "307,72,0,0" vertical alignment = "top" fontfileily = "segoyi UI" height = "33" font seices = "18" /> & Lt; Name text box = "txtRoom" KeyboardNavigation.TabIndex = "3" Template = "{StaticResource TextBoxBaseControlTemplate}" Margin = "396,l2l,75,97" FontFamily = "Segoe UI" FONTSIZE = "16" VerticalContentAlignment = "center" / Gt; & Lt; Label x: name = "lblRoom" content = "cell:" horizontal alignment = "left" margin = "325,134,0,0" vertical alignment = "top" fontfileily = "segoyi UI" height = "33" fontisystem = "18" /> & Lt; TextBox x: Name = "txtDnsName" KeyboardNavigation.TabIndex = "1" template = "{StaticResource TextBoxBaseControlTemplate}" Margin = "139,183,339,35" FontFamily = "Segoe UI" FONTSIZE = "16" VerticalContentAlignment = "center" / & gt ; & Lt; Label x: Name = "LblDnsName" content = "DNS name:" horizontal alignment = "Left" Margin = "35,196,0,0" Vrtiklelinement = "top" Fontfamili = "Segoi UI" height = "33" Fontsisej = "18 "/> & Lt; Expander x: name = "exp advanced" header = "advanced ..." horizontal align = "left" margin = "262,234,0,0" vertical alignment = "top" & gt; & Lt; Grid background = "# FFE5E5E5" & gt; & Lt; Label x: name = "lblExpanded" content = "extended!" / & Gt; & Lt; / Grid & gt; & Lt; / Expander & gt; & Lt; / Grid & gt;
Check horizontal and vertical alignment properties that they Are set to stretch by default
Comments
Post a Comment