FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to disable a Button on the Fly / while runtime
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
How to disable a Button on the Fly / while runtime
Posted: Sat Sep 06, 2008 08: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.

@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

@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
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM
Re: How to disable a Button on the Fly / while runtime
Posted: Sat Sep 06, 2008 08: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.

@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

@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:={ || .F.},SysRefresh()

Patrick
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
How to disable a Button on the Fly / while runtime
Posted: Sat Sep 06, 2008 08:41 AM
Thankyou Mr.Patric

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


Your solution worked.

Anser

Continue the discussion