Consider this small sample.
Code: Select all
/*
* HMG Hello World Demo
* (c) 2002-2004 Roberto Lopez <mail.box.hmg@gmail.com>
*/
#include "hmg.ch"
Function Main
DEFINE WINDOW Win1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'Hello World!' ;
MAIN
DEFINE LISTBOX LIST1
ROW 10
COL 10
WIDTH 100
HEIGHT 110
ITEMS { '01','02','03','04','05','06','07','08','09','10' }
multiselect .t.
END LISTBOX
define button click
row 10
col 120
width 50
caption "Click"
action Win1.LIST1.value := {1,2}
end button
END WINDOW
Win1.LIST1.value := {1,2}
ACTIVATE WINDOW Win1
Return
I want to show the listbox with the first and second item, selected.