How To Disable Items In A ComBo Box

How To Disable Items In A ComBo Box

Postby acwoo1 » Mon Mar 04, 2013 3:05 pm

Hi
Code: Select all  Expand view
function main

   local oDlg
   local oCombo1
   local oCombo2
   local oCombo3
   local oCombo4
   local cCombo1
   local cCombo2
   local cCombo3
   local cCombo4


   aUsers1_ := {}
   aUsers2_ := {}
   aUsers3_ := {}
   aUsers4_ := {}
 
        DEFINE DIALOG oDlg FROM 0, 0 TO 26, 79 ;
        TITLE "Test" ;
          GRADIENT { { 1, nRGB( 199, 216, 237 ), nRGB( 237, 242, 248 ) } }

            aadd(aUsers1_, "A")
            aadd(aUsers1_, "B")
            aadd(aUsers1_, "C")
            aadd(aUsers1_, "D")

   @  8.1, 7 COMBOBOX oCombo1 VAR cCombo1 ITEMS aUsers1_ ;
      OF oDlg;
      ON CHANGE testcombo( cCombo1 )

   @ 9.95, 25.7 BUTTON "&Exit" OF oDlg SIZE 50, 12 ACTION ( oDlg:End() )

   ACTIVATE DIALOG oDlg CENTERED

 return nil
**********************************************
function testcombo( cCombo1 )


 mtest1  = cCombo1

return cCombo1
***********************

 


How do I disable items "B" and "C" in the combo box ?

Thanks
ACWoo
FWH1302+Harbour+bcc582
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am

Re: How To Disable Items In A ComBo Box

Postby Enrico Maria Giordano » Mon Mar 04, 2013 3:08 pm

You can't disable combobox items, as far as I know. But you can remove them from the list.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How To Disable Items In A ComBo Box

Postby ukoenig » Mon Mar 04, 2013 3:25 pm

Not delete, but replace the Items :

FUNCTION MAIN()
local oDlg
local oCombo1
local oCombo2
local oCombo3
local oCombo4

local cCombo1
local cCombo2
local cCombo3
local cCombo4

aUsers1_ := {}
aUsers2_ := {}
aUsers3_ := {}
aUsers4_ := {}

DEFINE DIALOG oDlg FROM 0, 0 TO 26, 79 ;
TITLE "Test" ;
GRADIENT { { 1, nRGB( 199, 216, 237 ), nRGB( 237, 242, 248 ) } }

aadd(aUsers2_, "B")
aadd(aUsers2_, "C")


aadd(aUsers1_, "A")
aadd(aUsers1_, "B")
aadd(aUsers1_, "C")
aadd(aUsers1_, "D")

@ 8.1, 7 COMBOBOX oCombo1 VAR cCombo1 ITEMS aUsers1_ ;
OF oDlg;
ON CHANGE testcombo( cCombo1 )

// Repaint with new Items
@ 9.95, 15 BUTTON "&Change" OF oDlg SIZE 50, 12 ;
ACTION ( oCombo1:SetItems( aUsers2_, .T. ), oCombo1:Select( 1 ) )


@ 9.95, 25.7 BUTTON "&Exit" OF oDlg SIZE 50, 12 ACTION ( oDlg:End() )

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How To Disable Items In A ComBo Box

Postby acwoo1 » Sun Mar 10, 2013 11:50 am

Thanks

Is there any other way to workaround this ?

Regards

ACWoo
FHW1302+Harbour+bcc582
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 96 guests