Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create custom method / property in VB?
Message
De
05/09/2000 21:29:21
Marlou Gargantos
Independent Consultant
Manila, Philippines
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
How to create custom method / property in VB?
Divers
Thread ID:
00412732
Message ID:
00412732
Vues:
46
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform