Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting ShowWindow Property
Message
De
10/12/2004 07:42:34
 
 
À
09/12/2004 10:44:41
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00968021
Message ID:
00968256
Vues:
7
>How can the ShowWindow property be set to In-Top-Level when doing a createobject('Form')? I keep getting a message that this property is read_only.

When a form it is created, before every other event,
VFP creates a OS window, and of it it declares the type.

To this point you could not more change type with VFP.

But a way simple indirect way exists in order to exceed the problem:
- create a "AS Top window", and changes its type in load, based on some rule.
this process it is irreversible, but can do the job.

A restriction: The Top Form it must not have a BAR MENU defined within of it.

Side effect:
With this way you can put a toolbar into a Child Form.

REPRO:
PUBLIC oform1
parentWindow = ""

oform1=CREATEOBJECT("genericForm")
oform1.Show
parentWindow = m.oform1.Name
oform1.Addproperty("ChildForm",CREATEOBJECT("genericForm"))
oform1.ChildForm.sHOW
RETURN

DEFINE CLASS genericForm AS form

	ShowWindow = 2
	Caption = "Generic"

	PROCEDURE Load
		this.Name = 'Fm'+SYS(2015)	&& this is incorrect, but for this test it is sufficient
		this.AddProperty("tb",CREATEOBJECT("toolbar"))
		WITH m.this.tb
			.dock(0)
			.Caption = 'tb'+m.this.Name
			SHOW WINDOW (.caption) IN (m.this.Name)
		ENDWITH
		IF !EMPTY(m.parentWindow)
			? "BEFORE ",this.ShowWindow 
			SHOW WINDOW (m.this.Name) IN (m.parentWindow)
			* NOW THE FORM IT IS DECLASSED TO A SIMPLE CHILD FORM
			? "AFTER ",this.ShowWindow 	
		ELSE
			DEFINE MENU ('MM'+M.THIS.NAME) BAR IN (M.THIS.NAME)
			DEFINE PAD pa1  OF ('MM'+M.THIS.NAME) PROMPT 'TEST'
			ACTIVATE MENU ('MM'+M.THIS.NAME)		
		ENDIF
	ENDPROC
ENDDEFINE
Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform