FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TListBox:IsMultipleSel() refinement
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TListBox:IsMultipleSel() refinement
Posted: Thu Feb 16, 2006 01:10 PM
The following sample shows .F. when the button is clicked. But an extended selection listbox is a multi-selection listbox as well.

#include "Fivewin.ch"


#define LBS_EXTENDEDSEL     2048


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oLbx

    LOCAL cVar := ""

    DEFINE DIALOG oDlg

    @ 1, 1 LISTBOX oLbx VAR cVar ITEMS { "Bert", "Carl", "William" }

    oLbx:nStyle += LBS_EXTENDEDSEL

    @ 3, 1 BUTTON "&Test" ACTION MSGINFO( oLbx:IsMultipleSel() )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


This is a possible fix:

METHOD IsMultipleSel() INLINE lAnd( GetWindowLong( ::hWnd, GWL_STYLE ),;
                                       nOr( LBS_MULTIPLESEL, LBS_EXTENDEDSEL ) )


EMG

Continue the discussion