Reuse is the issue here. In VFP, it's easy to create custom property and custom method. This feature is very useful because it gives us convenient way of doing things. I want to have a custom method which will contain a routine that will enable/disable particular controls or objects within a form. In VFP, I can easily create a custom method say ObjectEnable. It will contain the below method:
LParameters lEnable
With Thisform
.txtBox1.Enabled = lEnable
.txtBox2.Enabled = lEnable
.txtBox3.Enabled = !lEnable
.cmdDelete.Enabled = lEnable
Endwith
I can call the method anywhere in the form say in the click event of a particular button:
Thisform.ObjectEnable(.T.) - To enable the controls
or
Thisform.ObjectEnable(.F.) - To disable the controls
I don't how to do it in VB?