Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Bindevent - click not working
Message
From
24/05/2016 19:05:48
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Problem with Bindevent - click not working
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01636754
Message ID:
01636754
Views:
92
Hello comunity

I have create a script that in practice create a button and on click i pretend do something.
My problem is Click don´t work , but button are create correctly.

My code are:

initobjecto("NossoTimer")
PDU_4N40ZH67F.AddObject("myTimer1","myTimer")
PDU_4N40ZH67F.myTimer1.Interval=1


Define Class myTimer As NossoTimer
Procedure Timer
If Wexist ("FTCOMVY")
PDU_4N40ZH67F.RemoveObject("myTimer1")

Local oHandler

*-- Bind the click event to a handler
oHandler = Newobject ("ClickHandler")

FTcomvy.bok2.AddObject ('cbotao1', 'commandbutton')

Bindevent (FTCOMVY.bok2.cbotao1, "Click", oHandler, "Build")

*-- Set the appearance of the button first ...
* Cria um botão
FTcomvy.bok2.cbotao1.caption = "Build"
* O botão fica activo
FTCOMVY.Bok2.cbotao1.Enabled=.T.
*posição
FTCOMVY.Bok2.cbotao1.Top = 5
FTCOMVY.Bok2.cbotao1.Left = 8
FTCOMVY.Bok2.cbotao1.Height = 27
*-- ... then make it visible.
FTCOMVY.Bok2.cbotao1.Visible = .T.
Endif

If(PDU_4N40ZH67F.Visible)
Hide Window "PDU_4N40ZH67F"
Endif
Endproc
Enddefine

*----------------------------------------
Define Class ClickHandler As Session
Procedure build
msg("on mybotao click")
doread("FO","SFO")
Return
Enddefine

Someone have an ideia about why the click don´t work

Best regards
Luis
Next
Reply
Map
View

Click here to load this message in the networking platform