[Mono-list] Listbox with multiple choice

Andy Hume andyhume32 at yahoo.co.uk
Tue Aug 19 10:28:05 EDT 2008



Zuiop wrote:
> 
> i'm new to mono and i have got a "silly" question...
> I program an application by using the .net compact framework and I have
> noticed that are no properties for multiplechoice/singlechoice in the
> class "listbox" and in the class "listview". 
> But I need a list-class, multiple-choice capable. Is there such a class in
> the Mono-Framework? Or is there a way to a class with the Mono framework
> to implement quickly?
> Thank you
> 

The first question is how the user would be able to select multiple items. 
On desktop platforms one uses Shift or Ctrl with a mouse click.  Are you
running on a CE platform that has both types of input device?  On WM one
would normally have either a touch screen *or* a small keyboard.  So that
input behaviour isn't possible.  (The built-in Messenger app allows one to
select multiple adjacent items only, by dragging across them).


Anyway, ListView in NETCF does support multiple selection.  That control has
a CheckBoxes property, so the user can select the required items by
checking/unchecking the checkboxes[1].  Would that suit?


Otherwise it might be possible to use Mono's WinForms implementation --
which is often called MWF (Managed-Windows-Forms) as it is a fully managed
implementation, doing all work via System.Drawing and using no native
controls (well apart from the window itself).

I think I've heard of some people actually using the 'whole' Mono
runtime+classes on CE/WM instead of coping with the cut-down NETCF, I can't
find the reference just now.

Otherwise you could try just compiling the MWF library for the the NETCF
runtime, which *might* work -- depends on how much is missing in
System.Drawing.   Give it a different (or empty) Strong-Name so that your
application can link to it rather than the reference being 'unified' to the
built-in SWF assembly when loaded by the CF runtime.  Or, if the whole
assembly is too hard to compile, then I guess one could try compiling
ListView/ListBox+subclasses alone


Hope that makes sense/helps...
Andy



[1] The program finds which items are checked by reading the Checked
property of the each item; perhaps from the ItemClick event -- remembering
that it occurs *before* the state is updated so combine the item change
event args with the current item state.

-- 
View this message in context: http://www.nabble.com/Listbox-with-multiple-choice-tp18999613p19050570.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list