Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global position of control in _Screen/Toplevel form
Message
De
07/06/2005 10:49:09
 
 
À
07/06/2005 10:34:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01020751
Message ID:
01020933
Vues:
33
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Fabio,
>
>Your code works as expected! I had previously tried the SetFocus() technique without success and blamed its failure on VFP toolbars preserving the current control's focus vs. me being an idiot programmer. After running your code, I am embarrassed to admit that the source of the problem was me being an idiot programmer.

>
>Mille Grazie!
>
>Malcolm

Malcolm,
careful, the race ends soon against a bug.

Run this,
- press GO
- click on 2th TextBox
- click on 1th TextBox
*** GAME OVER ****
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	autocenter = .T.
	Caption = "Toolbar focus"
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 28, ;
		Left = 64, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "OPEN", ;
		Name = "Command1"

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 76, ;
		Left = 96, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "GO", ;
		Enabled = .F., ;
		Name = "Command2"


	PROCEDURE command1.Click
		this.Enabled = .F.
		=ADDPROPERTY(m.thisform,"tb_fonts",CREATEOBJECT("tbarFonts"))
		thisform.command2.Enabled = .t. 
	ENDPROC


	PROCEDURE command2.Click
		thisform.tb_fonts.TextBox1.SetFocus
	ENDPROC

ENDDEFINE

DEFINE CLASS tbarFonts AS Toolbar
	ADD OBJECT TextBox1 AS TextBox
	
	ADD OBJECT TextBox2 AS TextBox
	
	PROCEDURE Init
		this.Dock(0)
		this.Visible = .T.
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform