Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Focus & Pageframe
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Focus & Pageframe
Miscellaneous
Thread ID:
00006218
Message ID:
00006218
Views:
114
* Petit programme pour démontrer un comportement bizarre de VFP.
*
* Si on clique sur la "page2" du formulaire, le focus se positionne sur le bouton "command2".
* Le code "When" et "GotFocus" de la zone de saisie "text1_page2" est quand même exécuté???
* Jamais le code "Valid" et "LostFocus" ne seront exécuté car le focus est maintenant sur "command2".
* Comment éviter d'exécuter le code "When" et "GotFocus" de la zone de saisie "text1_page2"
* quand on clique sur la "page2"?
* Si on utilise le bouton "command3" pour changer de page,
* le code "When" et "GotFocus" de la zone de saisie "text1_page2" n'est pas exécuté???

PUBLIC oform1

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

DEFINE CLASS form1 AS form

Caption = "Form1"
Name = "Form1"

ADD OBJECT pageframe1 AS pageframe WITH ;
PageCount = 2, ;
Top = 8, ;
Left = 8, ;
Width = 249, ;
Height = 233, ;
TabIndex = 4, ;
Name = "Pageframe1", ;
Page1.Caption = "\ Page1.Name = "Page1", ;
Page2.Caption = "P\ Page2.Name = "Page2"

ADD OBJECT command1 AS commandbutton WITH ;
Top = 10, ;
Left = 265, ;
Height = 25, ;
Width = 100, ;
Caption = "Command1", ;
TabIndex = 1, ;
Name = "Command1"

ADD OBJECT command2 AS commandbutton WITH ;
Top = 60, ;
Left = 265, ;
Height = 25, ;
Caption = "Command2", ;
TabIndex = 2, ;
Name = "Command2"

ADD OBJECT command3 AS commandbutton WITH ;
Top = 110, ;
Left = 265, ;
Height = 25, ;
Caption = "Command3", ;
TabIndex = 3, ;
Name = "Command3"

PROCEDURE pageframe1.init
THIS.page1.ADDOBJECT("text1_page1","text1")
WITH THIS.page1.text1_page1
.Height = 25
.Left = 38
.TabIndex = 1
.Top = 156
.visible = .T.
.Width = 161
ENDWITH
THIS.page2.ADDOBJECT("text1_page2","text2")
WITH THIS.page2.text1_page2
.Height = 25
.Left = 42
.TabIndex = 1
.Top = 32
.visible = .T.
.Width = 161
ENDWITH
ENDPROC

PROCEDURE pageframe1.Page2.Activate
THISFORM.Command2.SetFocus()
ENDPROC

PROCEDURE command3.Click
IF THISFORM.pageframe1.ActivePage = 1
THISFORM.pageframe1.ActivePage = 2
ELSE
THISFORM.pageframe1.ActivePage = 1
ENDIF
ENDPROC

ENDDEFINE

DEFINE CLASS text1 AS textbox
Height = 25
Width = 161
ENDDEFINE

DEFINE CLASS text2 AS textbox
Height = 25
Width = 161

PROCEDURE When
WAIT WINDOW '"When" du "textbox" de la "page2"'
ENDPROC

PROCEDURE Valid
WAIT WINDOW '"Valid" du "textbox" de la "page2"'
ENDPROC

PROCEDURE LostFocus
WAIT WINDOW '"LostFocus" du "textbox" de la "page2"'
ENDPROC

PROCEDURE GotFocus
WAIT WINDOW '"GotFocus" du "textbox" de la "page2"'
ENDPROC

ENDDEFINE


* Vous pouvez me répondre en anglais
* Merci
Hervé BOUTIN
FP2.6 Dos et Windows VFP
E-Mail : boutin@qualite-info.fr
Reply
Map
View

Click here to load this message in the networking platform