Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closable
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00769659
Message ID:
00769961
Vues:
26
Hi Sandy,
(I changed the code below so the 2nd modal form changes the closable property of the first modal form via a button on the 2nd form)
Just to make sure I am understanding you correctly, is this what you want to do? (Try saving this code to a prg and running it):
MyForm = CREATEOBJECT('MyForm')  && Create a Form
MyForm.Show()
DO WHILE TYPE('Myform.Caption')="C"
	READ EVENTS
ENDDO
RETURN

**************************************************
*-- Class:        myform (c:\profiler\progs\myforms.vcx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   03/25/03 04:52:03 PM
*
DEFINE CLASS myform AS form


	DoCreate = .T.
	Caption = "Myform"
	WindowType = 1
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 96, ;
		Left = 103, ;
		Height = 27, ;
		Width = 168, ;
		Caption = "Toggle Closable Property", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 152, ;
		Left = 103, ;
		Height = 54, ;
		Width = 168, ;
		WordWrap = .T., ;
		Caption = "Run MyForm2 and Change this form to closable=.F. while it is running", ;
		Name = "Command2"


	PROCEDURE command1.Click
		wait WINDOW "changing closable property" nowait
		IF thisform.closable=.T.
			thisform.closable=.F.
		ELSE
			thisform.closable=.T.
		ENDIF
	ENDPROC


	PROCEDURE command2.Click
		thisform.closable=.F.
		MyForm2 = CREATEOBJECT('MyForm2')  && Create a Form
		MyForm2.Show()
		DO WHILE TYPE('Myform2.Caption')="C"
			READ EVENTS
		ENDDO
		thisform.closable=.T.
	ENDPROC


ENDDEFINE
*
*-- EndDefine: myform
**************************************************
**************************************************
*-- Class:        myform2 (c:\profiler\progs\myform.vcx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   03/25/03 04:58:14 PM
*
DEFINE CLASS myform2 AS form


	Top = 45
	Left = 45
	DoCreate = .T.
	Caption = "Myform2"
	WindowType = 1
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 96, ;
		Left = 103, ;
		Height = 27, ;
		Width = 168, ;
		Caption = "Toggle Closable Property", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 144, ;
		Left = 102, ;
		Height = 27, ;
		Width = 168, ;
		Caption = "Close", ;
		Name = "Command2"


	PROCEDURE command1.Click
		wait WINDOW "changing closable property on Myform" nowait
		IF TYPE('Myform.Caption')="C"
			IF myform.closable=.T.
				Myform.closable = .F.
			ELSE
				Myform.closable = .T.
			ENDIF
		ENDIF
	ENDPROC


	PROCEDURE command2.Click
		thisform.release()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: myform2
**************************************************
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform