c# - Horizontal Listbox item -


i want create horizontal listbox item suggestion of keyboard enter image description here

<scrollviewer zoommode="enabled"           horizontalscrollbarvisibility="visible"           verticalscrollbarvisibility="visible"           horizontalscrollmode="enabled"           verticalscrollmode="enabled">             <stackpanel orientation="horizontal">                 <listbox  grid.row="1"  name="recognizedlistbox">                     <listbox.itemtemplate>                         <datatemplate>                             <textblock foreground="black"  text="{binding}" />                         </datatemplate>                     </listbox.itemtemplate>                 </listbox>             </stackpanel>         </scrollviewer> 

when click on button, must show list horizontal code showing list

private async void recognizeallclick(object sender, routedeventargs e)     {          resultword = recognizershared.recognizestrokeslist(inkcanvas.children.tolist(), false);         if (resultword.equals(null) && resultword.equals(""))         {             var messagebox = new messagedialog("text not recognized.");             messagebox.commands.add(new uicommand("close"));             await messagebox.showasync();             resultword = null;         }         recognizedlistbox.itemssource = null;         recognizedlistbox.itemssource = resultword;     } 

but shows enter image description here

after add height="30" listbox, shows me 1 suggestion, , other word none enter image description here

solved

<listbox x:name="recognizedlistbox" >             <listbox.itemtemplate>                 <datatemplate>                     <stackpanel orientation="vertical">                         <textblock width="30" foreground="black"  text="{binding}" />                     </stackpanel>                 </datatemplate>             </listbox.itemtemplate>             <listbox.itemspanel>                 <itemspaneltemplate>                     <stackpanel orientation="horizontal"/>                 </itemspaneltemplate>             </listbox.itemspanel>         </listbox> 

enter image description here

try this:

<listbox>     <listbox.itemspanel>         <itemspaneltemplate>             <stackpanel orientation="horizontal"/>         </itemspaneltemplate>     </listbox.itemspanel>     <listbox.itemtemplate>         ...     </listbox.itemtemplate> </listbox> 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -