Hola,
Es posible cambiar en tiempo de ejecucion el estilo de un listbox ? Deseo pasar de multiselect a normal.
En la clase se define nStyle := nOr( ..., If( lMulti, LBS_MULTIPLESEL, 0 )...)
Gracias
#include "fivewin.ch"
STATIC oWnd, oLbx
FUNCTION Main()
LOCAL oBar
LOCAL aItems := { 'Primero', 'Segundo', 'Tercero' }
LOCAL cVar := ''
DEFINE WINDOW oWnd
DEFINE BUTTONBAR oBar OF oWnd
DEFINE BUTTON OF oBar ACTION TestStyle()
@50, 50 LISTBOX oLbx VAR cVar ITEMS aItems PIXEL SIZE 100, 100 OF oWnd
ACTIVATE WINDOW oWnd
RETU .T.
/*
* Window field offsets for GetWindowLong()
*/
#define GWL_WNDPROC (-4)
#define GWL_HINSTANCE (-6)
#define GWL_HWNDPARENT (-8)
#define GWL_STYLE (-16)
#define GWL_EXSTYLE (-20)
#define GWL_USERDATA (-21)
#define GWL_ID (-12)
STATIC FUNCTION TestStyle()
LOCAL nStyle := nOr( GetWindowLong( oLbx:hWnd, GWL_STYLE ), LBS_MULTIPLESEL )
SetWindowLong( oLbx:hWnd, GWL_STYLE, nStyle )
RETU NIL
DEFINE BUTTON OF oBar ACTION ReBuild( oWnd, oLbx, aItems, @cVar )
...
function ReBuild( oWnd, oLbx, aItems, cVar )
oLbx:End()
@50, 50 LISTBOX oLbx VAR cVar ITEMS aItems PIXEL SIZE 100, 100 OF oWnd MULTISEL
return nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 104 guests