Jump to content
Fivewin Brasil

Cor nos Botões


kapiaba

Recommended Posts




#Include 'Fivewin.Ch'

FUNCTION Main()

LOCAL oDlg, oBut1, oBut2, nKey := VK_RETURN

DEFINE DIALOG oDlg FROM 100 , 100 TO 500 , 500 PIXEL

oDlg:lHelpIcon := .F.

@ 1 , 10 BTNBMP oBut1 PROMPT "&1.First" SIZE 100 , 20 OF oDlg ;
ACTION ( sleep( 1000 ), ;
MsgInfo( "OK1" ), ;
oBut1:cCaption := "&1.First", ; // back to original promttext
oBut1:Refresh() ) ;
CENTER

oBut1:setcolor( CLR_WHITE , CLR_HBLUE )

@ 30 , 10 BTNBMP oBut2 PROMPT "&2.Second" SIZE 100 , 20 OF oDlg ;
ACTION ( sleep( 1000 ), ;
MsgInfo( "OK2" ), ;
oBut2:cCaption := "&2.Second", ; // back to original promttext
oBut2:Refresh() ) ;
CENTER

oBut2:setcolor( CLR_WHITE , CLR_HRED )

oDlg:bKeyDown := { |nKey| Premi( nKey , oBut1 , oBut2 ) }

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

// -----------------

FUNCTION PREMI( nKey , oBut1 , oBut2 )

LOCAL cPressed := UPPER( CHR( nKey ) )

DO CASE
CASE cPressed = "1"

oBut1:cCaption := "Pressed..."
oBut1:Refresh()
oBut1:Click()

CASE cPressed = "2"

oBut2:cCaption := "Pressed2.."
oBut2:Refresh()
oBut2:Click()

ENDCASE

RETURN( .T. )


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...