Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does BindEvent work with the
Message
 
 
To
03/05/2006 07:34:18
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01118720
Message ID:
01118722
Views:
13
This message has been marked as the solution to the initial question of the thread.
>By setting the BindEvent I was hoping that when .cboImportRiskCosts combo gets enabled the .lblImportRiskCosts label will become enabled and the same when the .cboImportRiskCosts combo becomes disabled, but nothing happens.
>=BINDEVENT( .lblImportRiskCosts, "Enabled", .cboImportRiskCosts, "Enabled" )

The delegate cannot be a property. It has to be a method.
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT cboimportriskcosts AS combobox WITH ;
		Height = 24, ;
		Left = 36, ;
		Top = 60, ;
		Width = 100, ;
		Name = "cboImportRiskCosts"

	ADD OBJECT lblimportriskcosts AS label WITH ;
		Caption = "Label1", ;
		Height = 17, ;
		Left = 240, ;
		Top = 60, ;
		Width = 40, ;
		Name = "lblImportRiskCosts"


	ADD OBJECT check1 AS checkbox WITH ;
		Top = 156, ;
		Left = 120, ;
		Height = 17, ;
		Width = 60, ;
		Alignment = 0, ;
		Caption = "", ;
		ControlSource = "Thisform.cboImportRiskCosts.Enabled", ;
		Name = "Check1"

	PROCEDURE setlabelenabled
		WITH Thisform
			.lblImportRiskCosts.Enabled = .cboImportRiskCosts.Enabled
		ENDWITH
	ENDPROC


	PROCEDURE Init
		=BINDEVENT( Thisform.cboImportRiskCosts, "Enabled", Thisform, "SetLabelEnabled" )
	ENDPROC


ENDDEFINE
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform