How to disable a Button on the Fly / while runtime

How to disable a Button on the Fly / while runtime

Postby anserkk » Sat Sep 06, 2008 8:07 am

Friends,

I am not able to disable a button on the fly.

I am able to disable the button while defining the button with When .F.

Code: Select all  Expand view
@3,20 BUTTON oBtn2 PROMPT "Close" SIZE 40,12 ACTION  { Dlg:End() }


But not possible to disable Button on the fly with the following code

Code: Select all  Expand view
@01,01 PROGRESS oProg POSITION 0 SIZE 255, 10
@03,10 BUTTON oBtn  PROMPT "Reindex" SIZE 40,12 ACTION  {oBtn2:bWhen:={ || .F.},SysRefresh(), ;DoIndexing(lAutoIndex,oDlg,oProg,oSay1,oSay2,oSay3) } DEFAULT
@03,20 BUTTON oBtn2 PROMPT "Close"    SIZE 40,12 ACTION  {  oDlg:End() } 


Any help ?

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How to disable a Button on the Fly / while runtime

Postby Patrick Mast » Sat Sep 06, 2008 8:22 am

Hello Anser,

anserkk wrote:Friends,

I am not able to disable a button on the fly.

I am able to disable the button while defining the button with When .F.

Code: Select all  Expand view
@3,20 BUTTON oBtn2 PROMPT "Close" SIZE 40,12 ACTION  { Dlg:End() }


But not possible to disable Button on the fly with the following code

Code: Select all  Expand view
@01,01 PROGRESS oProg POSITION 0 SIZE 255, 10
@03,10 BUTTON oBtn  PROMPT "Reindex" SIZE 40,12 ACTION  {oBtn2:bWhen:={ || .F.},SysRefresh(), ;DoIndexing(lAutoIndex,oDlg,oProg,oSay1,oSay2,oSay3) } DEFAULT
@03,20 BUTTON oBtn2 PROMPT "Close"    SIZE 40,12 ACTION  {  oDlg:End() } 


Any help ?


Use oBtn2:Disable() instead of {oBtn2:bWhen:={ || .F.},SysRefresh()

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby anserkk » Sat Sep 06, 2008 8:41 am

Thankyou Mr.Patric

Use oBtn2:Disable() instead of {oBtn2:bWhen:={ || .F.},SysRefresh()


Your solution worked.

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests