Page 1 of 1
Listbox
Posted: Wed May 27, 2009 9:25 am
by Wolfgang Ciriack
Hi,
i have a listbox for an array (aLeist can hold max. content of 5 database fields)
Code: Select all
@zl, 5 LISTBOX oBrw2 ;
ITEMS aLeist ;
UPDATE ;
SIZE 230, 30 PIXEL FONT oListFont
Now i want two buttons to add and to delete items. How can i do this ?
Anyone have an example ?
Re: Listbox
Posted: Wed May 27, 2009 12:56 pm
by Richard Chidiak
This is a sample, note i design from screen not from resources
HTH
Richard
Code: Select all
DEFINE WINDOW OWNDD TITLE "Pièces Détachées"
DEFINE FONT aFONT NAME "Tahoma" SIZE 0,-10
@ 0, 0 LISTBOX oBrw FIELDS ;
PKDET->PID, ;
GETPROD(PKDET->REFP), ;
TRANSFORM(PKDET->QTE,"@Z 999.99") ;
HEADERS "Code","Désignation","Quantité" ;
FIELDSIZES 70,110,40 ;
FONT AFONT ;
SIZE GETSYSMETRICS( SM_CXSCREEN ) , GETSYSMETRICS( SM_CYSCREEN ) - 70 OF Owndd
@ GETSYSMETRICS( SM_CYSCREEN ) - 65,10 BTNBMP OBTN1 FILE CurDir() + "\BMP\Nouveau.bmp" SIZE 40, 35 OF oWndd NOBORDER CENTER ;
ACTION NEWPD(OBRW,@TFAC)
oBtn1:SetColor( CLR_YELLOW , CLR_WHITE)
@ GETSYSMETRICS( SM_CYSCREEN ) - 65,80 BTNBMP OBTN2 FILE CurDir() + "\BMP\Modifier.bmp" SIZE 40, 35 OF oWndd NOBORDER CENTER ;
ACTION MODIPD(OBRW,@TFAC)
oBtn2:SetColor( CLR_YELLOW , CLR_WHITE)
@ GETSYSMETRICS( SM_CYSCREEN ) - 65,150 BTNBMP OBTN3 FILE CurDir() + "\BMP\SUPPRIMER.bmp" SIZE 40, 35 OF oWndd NOBORDER CENTER ;
ACTION SUPPD(OBRW,@TFAC)
oBtn3:SetColor( CLR_YELLOW , CLR_WHITE)
OBRW:nClrBackHead := CLR_YELLOW // header
OBRW:nClrForeHead := CLR_HBLUE // header
ACTIVATE WINDOW oWNDD MODAL
AFONT:END()
Re: Listbox
Posted: Wed May 27, 2009 1:22 pm
by Wolfgang Ciriack
Hello Richard,
thanks for your example, but i need to browse an array. But i have found a sample in this newsgroup from Enrico Maria Giordano , so my problem is solved.
Re: Listbox
Posted: Thu May 28, 2009 6:51 am
by Otto
Hello Wolfgang,
could you please post the link.
Thanks in advance
Otto
Re: Listbox
Posted: Thu May 28, 2009 7:32 am
by Wolfgang Ciriack