Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: vece walet
  Where is vece walet?
 tangerang
 Indonesia
 vece walet
 Tags
Subject: RE: when event
Thread ID: 228581 Message ID: 228638 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Wednesday, May 20, 2009 11:52:07 AM         
   


> THANK U MR. STEFAN

You are welcome :-)

> but i still don't understand.
> can you give me an example of using "PROCEDURE control.WHEN" applied on TEXTBOX
>

Yes, but I am not sure what you want to do exactly. Can you describe more details?

For what it's worth, control.When() is a very early event that runs even before control.GotFocus().
It's also a kind-of unusual event, not many people write When() code every day in VFP.
The following runnable example.prg uses When to prevent "Text2".GotFocus() if the "Check1".Value=.F.:

LOCAL loForm as Form
loForm = CREATEOBJECT('TestForm')
loForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
	AutoCenter = .T.
	ADD OBJECT Check1 as Checkbox WITH ;
		Left = 10, Top = 20, Value = .F.
	ADD OBJECT Text1 as Textbox WITH ;
		Left = 10, Top = 70, Width = 200, Value = 'focus dummy'
	ADD OBJECT Text2 as Textbox WITH ;
		Left = 10, Top = 120, Width = 200, Value = 'receives focus only if Check1=.T.'
	PROCEDURE Text2.When
		RETURN Thisform.Check1.Value
	ENDPROC
ENDDEFINE



hth
-Stefan

ENTIRE THREAD

when event Posted by vece walet @ 5/20/2009 3:41:18 AM
RE: when event Posted by Stefan Wuebbe @ 5/20/2009 9:22:32 AM
RE: when event Posted by vece walet @ 5/20/2009 10:50:12 AM
RE: when event Posted by Stefan Wuebbe @ 5/20/2009 11:52:07 AM