Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Forms to work like ActiveX Controls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00886615
Message ID:
00887001
Vues:
15
Russell,

You need to make your form top-level by setting the forms ShowWindow property to 2 and you also need to issue a READ EVENTS so that the form responds to events.
DEFINE CLASS MyAuto AS CUSTOM OLEPUBLIC
FirstName = "Russell"

PROCEDURE MyForm
oForm = CREATEOBJECT("testform")
oForm.Caption = "My Automation Server"
oForm.Visible = .T.

*!* >> Start event processing <<
READ EVENTS

RETURN "Form " + oForm.Caption && This works. ie form is still active.
ENDPROC 

ENDDEFINE 


define Class testform as Form

ShowWindow = 2

   add object cmdClose AS commandbutton WITH ;
      Top      = 213, ;
      Left     = 283, ;
      Height   = 27,  ;
      Width    = 84,  ;
      FontName = "Tahoma", ;
      FontSize = 8, ;
      Caption  = "\<Close", ;
      Name     = "cmdClose"


   procedure cmdClose.Click

      *!*
      *!* StartMode->2 = VFP started as an out-of-process EXE
      *!*                automation server.
      *!*
      wait window _VFP.StartMode

      CLEAR EVENTS
	
   endproc 

enddefine
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform