Re: ListView and multiselect

From: Tim Wilson ("Tim)
Date: 03/10/04


Date: Wed, 10 Mar 2004 17:17:54 -0500

See the attached solution.

-- 
Tim Wilson
.Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}
"Jason Bei" <jason@intuitivesystems.co.nz> wrote in message
news:Ohzl$puBEHA.744@TK2MSFTNGP10.phx.gbl...
> Hi Tim,
>
> Would you please tell me how to use your code successfully. I hope to
> make a listview multiselectable in pocket PC. I have tried your example
> as below, but it doesn't give me the expected result. How to call the
> function? I put it in the form's sub new.
>
> Thanks in advance
>
> Jason
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
begin 666 MultiSelectListView.zip
M4$L#!!0````(`#"):C".\?% ;P$``$H$```7````375L=&E396QE8W1,:7-T
M5FEE=RYS;&ZMDEUO@C 4AJ\EX3\T7+G$$AC(Q\4NH)5ER9:8D7@/4DVWCAI:
MW(SSOZ\H?D63:?2"M'U/SW/><^@;'5=<\(D$(RKJC(%4U@7E(.6LEI27(*&,
M]$#"JZ],W2&5:,3 M"Q=&U;\@XQEUUBBV$6#`'G0CG$,78Q\&+G8@5X_LL,P
M]/W')%@9#^ )&&\UDS0E3"6^4B%'E'P;O;.R.<^+F2K1A)>!CVTG2@+H>XX+
M712$,$3]!-J6%V#LN(ECQRM#USJMJ51]RFFW/6(R(V5!RC$EHK$QXT*V(94S
M*(OC-%W;2[KVS'B>,75OL]FBMR-"O)S0:5UES6$-K\@VII(ZF.3U5,GKM1'>
M59N9($IJ=QL+1_23:JV;TV*JD\-JETW*7)LQ(\6>$S39V?L=\O$GD6"(KF;%
M-66%:=V!I'X6XXL;4>UHCUILM9MX^S;O03MH]1SNWU<Q^)&D%#2GC,K%)B3.
MO(KK.%%1O)2787:*KOT!4$L#!!0````(`-"):C"/:(*3J08``-X@```*````
M1F]R;3$N<F5S>-U:;6_;-A#^/F#_@1.&=0-LV8Z;)C7L%(W3M,&2M*B-ML"P
M#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)B*6(HAO!&7?"V
M"$#L05RM\R'E"G*\2!$:A1+9%8(7A!/"NKIK3J"04!.L"&=YKXII^Q46<68&
M1_9E]71Y>AG!8X'2/FSE+_J0=RZVNIHN$?K^7!QZ>:*2YWE/*0.@.IMI<F62
MXPA:1:Q#>/+7T0YG3FBJ_FP-7]\12;B;XVZ.3N2_F<.QJ]56WX'VY1)TEBH!
M4;:M?1G.^.Y0`BY(#2#3[2=.0Q M5:KA*X8[MF(-6NZJX7FX@$I@3>"K-EM/
MA(*LD=7#'?MB\3MV^T_"</ #4$L!`A0`% ````@`,(EJ,([Q\4!O`0``2@0`
M`!<``````````0`@`+:!`````$UU;'1I4V5L96-T3&ES=%9I97<N<VQN4$L!
M`A0`% ````@`T(EJ,(]H@I.I!@``WB ```H``````````0`@`+:!I $``$9O
M<FTQ+G)E<WA02P$"% `4````" #0B6HPK0[]0/(#```N$ ``" `````````!
M`" `MH%U" ``1F]R;3$N=F)02P$"% `4````" `OB6HPQ&APSH\!``!S`P``
M#P`````````!`" `MH&-# ``07-S96UB;'E);F9O+G9B4$L!`A0`% ````@`
MXHEJ, 0778@[!@```" ``!<````````````B`+:!20X``$UU;'1I4V5L96-T
M3&ES=%9I97<N<W5O4$L!`A0`% ````@`+XEJ,$,,9P^T`P``)Q<``!L`````
M`````0`@`+:!N10``$UU;'1I4V5L96-T3&ES=%9I97<N=F)D<')O:E!+`0(4
M`!0````(`.*):C"/+:KBC $``#X(```@``````````$`( "V@:88``!-=6QT
M:5-E;&5C=$QI<W16:65W+G9B9'!R;VHN=7-E<E!+!08`````!P`'`,P!``!P
%&@``````
`
end