Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form won't close
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01556913
Message ID:
01556914
Vues:
31
Add before
oFrm.Release
if vartype(oFrm) = 'O'
   oFrm.Release()
endif
BTW, do you keep creating your forms in code?

>well i solved one problem and another one rises up to takes it's place.
>
>I changed ofrm.show to ofrm.show(1) and got the form to appear and allow editing but now i can't get the form to close
>
>I get an error message 'ofrm if not an object' on this line: ofrm.release()
>
>Does anyone know why this has suddenly appeared. HELP!!
>
>tnx
>k
>
>
>
>
>*LOCAL oFrm
>
>oFrm= CREATEOBJECT("Note")
>oFrm.Edit1.Value = filetostr('m.txt') 
>oFrm.caption = 'Notes for '+tnom 
>oFrm.closable = .f.
>oFrm.MinButton = .f.
>oFrm.MaxButton = .f.
>**left,top,width,height
>oFrm.move(338, 22, 575,574,)
>
>ofrm.AddObject('cmdCmndBtn1','cmdMyCmndBtn1')  
>ofrm.cmdCmndBtn1.Visible =.T.  
>ofrm.AddObject('cmdCmndBtn2','cmdMyCmndBtn2')  
>ofrm.cmdCmndBtn2.Visible =.T.  
>
>oFrm.Show(1)
>READ EVENTS  && Start event processing
>
>ofrm.release() 
>************************************
>DEFINE CLASS Note AS Form
>	ADD OBJECT Edit1 AS EditBox WITH ;
>		Height= 440, ;
>		Left= 16, ;
>		ReadOnly= .f., ;
>		TabIndex= 2, ;
>		Top= 16, ;
>		Width= 530, ;
>		Value= ""
>ENDDEFINE
>
>DEFINE CLASS cmdMyCmndBtn1 AS COMMANDBUTTON  
>   Caption = 'SAVE Exit' 
>   Left = 100  
>   Top = 490  
>   Height = 35  
>  BackColor = RGB(255,255,110)
> 
> PROCEDURE Click
>
>replace memonote with oFrm.Edit1.Value IN mytable
>CLEAR EVENTS  && Stop event processing, close Form    
>ENDDEFINE
>
>DEFINE CLASS cmdMyCmndBtn2 AS COMMANDBUTTON  
>   Caption = 'EXIT NoSave'  
>   Left = 375 
>   Top = 490 
>   Height = 35  
>  BackColor = RGB(255,255,110)
> 
> PROCEDURE Click
>wait window 'changes have not been saved'+CHR(13)+CHR(13)+'exiting .. '  timeout 2 at 12,80 
>CLEAR EVENTS  && Stop event processing, close Form
>ENDDEFINE
>
>Public Event MouseWheel As MouseWheelEventHandler
>
>PROCEDURE Object.MouseWheel
>LPARAMETERS nDirection, nShift, nXCoord, nYCoord
>
>PROCEDURE edit1.MouseWheel
>		LPARAMETERS nDirection, nShift, nXCoord, nYCoord
>
>* Set focus to this control
>		If Type("thisform.ActiveControl") # "O" or thisform.ActiveControl <> this
>			this.SetFocus
>		EndIf
>	
>	ENDPROC
>oFrm.hide(1)
>
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform