METHOD Select( nItem ) INLINE ::nAt := nItem,;
::SendMsg( CB_SETCURSEL, nItem - 1, 0 )It seems, that the variable is not updated if i use ::select(). In method Select() should be added a ::change()!
METHOD Select( nItem ) INLINE ::nAt := nItem,;
::SendMsg( CB_SETCURSEL, nItem - 1, 0 )Günther,
Have you modified it and is it working fine ?
I have a long time tested as the variable after ::select() was NOT changed according to the new position. Then i checked also the code from Listbox and there on the same place ::change() is calling. The ::select() is a movement and also must be
updating the variable and eval(bChange) if exist.
Please show me how you have modified it
METHOD SelectItem( nItem ) CLASS TComboBox
::nAt := nItem
::SendMsg( CB_SETCURSEL, nItem - 1, 0 )
if ::nAt == 0
return nil
endif
if ::nAt <= Len( ::aItems )
if ValType( Eval( ::bSetGet ) ) == "N"
Eval( ::bSetGet, ::nAt )
else
Eval( ::bSetGet, ::aItems[ ::nAt ] )
endif
endif
if ! Empty( ::oGet:hWnd )
::oGet:VarPut( Eval( ::bSetGet ) )
::oGet:Refresh()
endif
if ::bChange != nil
Eval( ::bChange , self , ::GetText() )
endif
return nilGünther,
Have you checked if bChange gets executed twice ?
Please call MsgInfo() from it and check if it gets called just once
thanks