Listbox

Post Reply
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Listbox

Post 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 ?
Best regards
Wolfgang Ciriack
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Listbox

Post 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()
 
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Re: Listbox

Post 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.
Best regards
Wolfgang Ciriack
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Listbox

Post by Otto »

Hello Wolfgang,
could you please post the link.
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Wolfgang Ciriack
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Re: Listbox

Post by Wolfgang Ciriack »

Best regards
Wolfgang Ciriack
Post Reply