ComboBoxAdv


Display a Window containing a ComboBoxAdv, allowing the user to select one or more items.  Return the number of selected items and their values.



XAML


∇  xaml←ComboBoxAdvXAML
⍝ XAML for the ComboBoxAdv example
 xaml←⊂'<Window'
 xaml,←⊂'    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
 xaml,←⊂'    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"'
 xaml,←⊂'    xmlns:sftools="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=SyncFusion.Shared.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sftools:ComboBoxAdv Name="cboAdv" AllowMultiSelect="True">'
 xaml,←⊂'        </sftools:ComboBoxAdv>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇  z←ComboBoxAdv(text items);⎕IO;⎕ML;xaml;item
⍝ Simple ComboBoxAdv example
 ⎕IO ⎕ML←0 3
 xaml←ComboBoxAdvXAML
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_cboAdv←#.window.FindName⊂'cboAdv'
 window_cboAdv.DefaultText←text
 :For item :In items
     {}window_cboAdv.Items.Add⊂item
 :EndFor
 {}#.window.ShowDialog
 z←window_cboAdv.SelectedItems.Count(⌷window_cboAdv.SelectedItems)


The 'SyncTools' argument to #.UTIL.LoadXAML has the effect of adding

'Syncfusion.Windows.Shared,Syncfusion/4.5/Syncfusion.Shared.WPF.dll'
'SyncFusion.Windows.Tools.Controls,Syncfusion/4.5/Syncfusion.Tools.WPF.dll

 to the ⎕USING list of
LoadXAML

Operation


      #.ComboBoxAdv.ComboBoxAdv 'Take your pick' ('Eeny' 'Meeny' 'Miny' 'Mo')   
2   Eeny Meeny 

Unresolved Issues


Explore more properties