Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINDEVENT() and properties
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00809607
Message ID:
00809639
Views:
46
Thanks Sergey,

Just than I figured but I was playing around with SelStart. In the following code mymethod2 is fired but not mymethod3. Seems that SelStart is not bindable. Even SelStart_Assign doesn't work.
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


	Top = 0
	Left = 2
	Height = 212
	Width = 353
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
	myproperty = .F.

	ADD OBJECT textbox1 AS TextBox WITH ;
		Top = 40, ;
		Left = 86, ;
		Height = 27, ;
		Width = 100, ;
		Value = "TESTING", ;
		Name = "TextBox1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 96, ;
		Left = 36, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "MyProperty", ;
		Name = "Command1"

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 96, ;
		Left = 204, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "WindowState", ;
		Name = "Command2"

	PROCEDURE mymethod2
		DEBUGOUT "SELSTART", TIME(), PROGRAM(), Thisform.Textbox1.SelStart
	ENDPROC

	PROCEDURE mymethod3
		LPARAMETERS A, B
		DEBUGOUT "KEYB", TIME(), PROGRAM(), Thisform.Textbox1.SelStart
	ENDPROC

	PROCEDURE mymethod
		DEBUGOUT TIME(), PROGRAM(), Thisform.MyProperty
	ENDPROC

	PROCEDURE othermethod
		DEBUGOUT TIME(), PROGRAM(), Thisform.WindowState
	ENDPROC

	PROCEDURE Init
    	BINDEVENT(Thisform.TextBox1, "Keypress", Thisform, "mymethod3")
		BINDEVENT(Thisform.TextBox1, "SelStart", Thisform, "mymethod2")
		BINDEVENT(Thisform, "myproperty", Thisform, "mymethod")
		BINDEVENT(Thisform, "WindowState", Thisform, "OtherMethod",2)
	ENDPROC


	PROCEDURE command1.Click
		Thisform.myproperty = DATETIME()
	ENDPROC

	PROCEDURE command2.Click
		IF Thisform.WindowState = 0
			Thisform.WindowState = 2
		ELSE
			Thisform.WindowState = 0
		ENDIF
	ENDPROC

	PROCEDURE Textbox1.SelStart_assign
	  LPARAMETERS lNewValue
  	   
  	  DEBUGOUT "ASSIGN", TIME(), PROGRAM(), m.lNewValue
  	  
	  This.SelStart = m.lNewValue
	  
	Endproc

	PROCEDURE Textbox1.SelStart_access
  	   
  	  DEBUGOUT "Access", TIME(), PROGRAM(), This.SelStart
  	  
	Endproc

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform