How to Add Object button in VFP _Screen Desktop

Public oHandler

oHandler = Newobject ("ClickHandler")

WITH _SCREEN
_SCREEN.Caption='SHOW BUTTON IN VFP DESKTOP SCREEN'
.ADDOBJECT("command1","commandbutton")
Bindevent (.COMMAND1, "Click", oHandler, "Build")
WITH .COMMAND1
.Top = 80
.Left = 10
.Height = 48
.Width = 228
.FontBold = .T.
.FontSize = 12
.Caption = "SHOW BUTTON 1"
.SpecialEffect = 0
.BackColor = RGB(255,88,9)
.Themes = .T.
.Name = "Command1"
.VISIBLE=.T.
ENDWITH

.ADDOBJECT("command2","commandbutton")
Bindevent (.COMMAND2, "Click", oHandler, "Build1")
WITH .COMMAND2
.Top = 150
.Left = 10
.Height = 48
.Width = 228
.FontBold = .T.
.FontSize = 12
.Caption = "SHOW BUTTON 2"
.SpecialEffect = 0
.BackColor = RGB(255,88,9)
.Themes = .T.
.Name = "Command2"
.VISIBLE=.T.
ENDWITH
ENDWITH

*----------------------------------------
Define Class ClickHandler As Session
Procedure Build
MESSAGEBOX(1)
Return

Procedure Build1
MESSAGEBOX(2)
Return
Enddefine

Comments

Popular posts from this blog

(VFP) - Running Visual FoxPro on Linux

(VFP) - How to put calendar on your vfp application

(VFP) - How To Run Exe File and include them to your Project