c# - Horizontal Listbox item -
i want create horizontal listbox item suggestion of keyboard
<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
after add height="30" listbox, shows me 1 suggestion, , other word none
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>
try this:
<listbox> <listbox.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal"/> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> ... </listbox.itemtemplate> </listbox>
Comments
Post a Comment