Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read Events not working with CrateObject()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Read Events not working with CrateObject()
Miscellaneous
Thread ID:
00652647
Message ID:
00652647
Views:
71
Using the CreateObject() and AddObject() to create a form at runtime. When I call such code from an EXE or complied project the new form flashes and disappears. I am guessing the "Read Events" is being ignored since I already have one at the begining of the application.

Therefore, how do the second "Read Events" does not work what is my alternative?



frmMyForm = CREATEOBJECT('Form') && Create a Form
frmMyForm.Closable = .f. && Disable the Control menu box


frmMyForm.AddObject('cmbCommand1','cmdMyCmdBtn')

frmMyForm.cmbCommand1.Visible =.T. && "Quit" Command button visible

frmMyForm.SHOW && Display the form
READ EVENTS && Start event processing

DEFINE CLASS cmdMyCmdBtn AS CommandButton && Create Command button
Caption = '\ Cancel = .T. && Default Cancel Command button (Esc)
Left = 125 && Command button column
Top = 210 && Command button row
Height = 25 && Command button height

PROCEDURE Click
CLEAR EVENTS && Stop event processing, close Form
CLEAR && Clear main Visual FoxPro window
ENDDEFINE
Best Regards,
Lee Roy J. Pitre, Jr, AAS, BA, MS
Pitre Computer Consultant & Associates
http://pitres.us
Next
Reply
Map
View

Click here to load this message in the networking platform