wpf - Putting Stack Panels side by side -



wpf - Putting Stack Panels side by side -

i need set controls grouped , set them side side. , came code utilize multiple stackpanel that.

<window x:class="xamltests.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="310" width="525"> <grid> <stackpanel x:name="_ribbonradiobuttonpanel" orientation="vertical"> <checkbox content="signed" height="16" name="signed" checked="signed_checked" margin="10,5"/> <stackpanel x:name="_wordlength" orientation="horizontal"> <textbox height="18" name="textboxwordlength" width="30" margin="10,5"/> <textblock height="20" name="textblockwordlength" text="word length" width="120"/> </stackpanel> <stackpanel x:name="_integerwordlength" orientation="horizontal"> <textbox height="18" name="textboxintegerwordlength" width="30" margin="10,5"/> <textblock height="20" name="textblockintegerwordlength" text="integer word length" width="120"/> </stackpanel> </stackpanel> <stackpanel x:name="_ribbonradiobuttonpanel2"> <stackpanel x:name="_max" orientation="horizontal"> <textbox height="18" name="maxtextbox" width="100" margin="10,5"/> <textblock height="20" name="maxtextblock" text="max" width="120"/> </stackpanel> <stackpanel x:name="_min" orientation="horizontal"> <textbox height="18" name="mintextbox" width="100" margin="10,5"/> <textblock height="20" name="mintextblock" text="min" width="120"/> </stackpanel> <stackpanel x:name="_delta" orientation="horizontal"> <textbox height="18" name="deltatextbox" width="100" margin="10,5"/> <textblock height="20" name="delattextblock" text="delta" width="120"/> </stackpanel> </stackpanel> </grid> </window>

however, got stackpanels overapped. what's wrong xaml? layout panels used aligning multiple components?

you following...

<grid> <grid.columndefinitions> <columndefinition/> <columndefinition/> </grid.columndefinitions> <stackpanel x:name="_ribbonradiobuttonpanel" orientation="vertical" grid.column="0"> <checkbox content="signed" height="16" name="signed" checked="signed_checked" margin="10,5"/> <stackpanel x:name="_wordlength" orientation="horizontal"> <textbox height="18" name="textboxwordlength" width="30" margin="10,5"/> <textblock height="20" name="textblockwordlength" text="word length" width="120"/> </stackpanel> <stackpanel x:name="_integerwordlength" orientation="horizontal"> <textbox height="18" name="textboxintegerwordlength" width="30" margin="10,5"/> <textblock height="20" name="textblockintegerwordlength" text="integer word length" width="120"/> </stackpanel> </stackpanel> <stackpanel x:name="_ribbonradiobuttonpanel2" grid.column="1"> <stackpanel x:name="_max" orientation="horizontal"> <textbox height="18" name="maxtextbox" width="100" margin="10,5"/> <textblock height="20" name="maxtextblock" text="max" width="120"/> </stackpanel> <stackpanel x:name="_min" orientation="horizontal"> <textbox height="18" name="mintextbox" width="100" margin="10,5"/> <textblock height="20" name="mintextblock" text="min" width="120"/> </stackpanel> <stackpanel x:name="_delta" orientation="horizontal"> <textbox height="18" name="deltatextbox" width="100" margin="10,5"/> <textblock height="20" name="delattextblock" text="delta" width="120"/> </stackpanel> </stackpanel> </grid>

this set controls separate columns not overlap. approach set stack panels stackpanel has orientation set horizontal following...

<stackpanel orientation="horizontal"> <stackpanel x:name="_ribbonradiobuttonpanel" orientation="vertical" grid.column="0"> <checkbox content="signed" height="16" name="signed" checked="signed_checked" margin="10,5"/> <stackpanel x:name="_wordlength" orientation="horizontal"> <textbox height="18" name="textboxwordlength" width="30" margin="10,5"/> <textblock height="20" name="textblockwordlength" text="word length" width="120"/> </stackpanel> <stackpanel x:name="_integerwordlength" orientation="horizontal"> <textbox height="18" name="textboxintegerwordlength" width="30" margin="10,5"/> <textblock height="20" name="textblockintegerwordlength" text="integer word length" width="120"/> </stackpanel> </stackpanel> <stackpanel x:name="_ribbonradiobuttonpanel2" grid.column="1"> <stackpanel x:name="_max" orientation="horizontal"> <textbox height="18" name="maxtextbox" width="100" margin="10,5"/> <textblock height="20" name="maxtextblock" text="max" width="120"/> </stackpanel> <stackpanel x:name="_min" orientation="horizontal"> <textbox height="18" name="mintextbox" width="100" margin="10,5"/> <textblock height="20" name="mintextblock" text="min" width="120"/> </stackpanel> <stackpanel x:name="_delta" orientation="horizontal"> <textbox height="18" name="deltatextbox" width="100" margin="10,5"/> <textblock height="20" name="delattextblock" text="delta" width="120"/> </stackpanel> </stackpanel> </stackpanel>

there numerous other ways of doing desired result.

wpf visual-studio-2010 xaml

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -