Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Compound member attributes

Total Hit ( 2762)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


The Procedure Attributes dialog includes a Procedure ID combo box, that lets you associate a particular ID to a given member of the class. You usually use this combo to make a property or a method the default item of a class or an ActiveX control, but there are other uses as well. For instance, you may want to associate a Text property to the Text attribute, or a Caption property with the Caption attribute. This is necessary to have these properties behave like they do in standard VB controls: when the user enters a new value in the Property Window, the new value appears immediately in the control, as he or she types each key.

It is not infrequent that you want to combine these attributes with the default ID: if you are writing an enhanced textbox control, for example, its Text property will be also the default property of the control. It is evident that you can't select two IDs for the same property, and you have to resort to the following trick.

Define the Text or Caption property as always, and assign it the corresponding attribute. Then define a new property and make it hidden. This new property - whose name is not really important, because it won't be seen by the user - just delegates to the actual property. For example, you can use a property name that includes a trailing underscore:

Click here to copy the following block
Property Get Text_() As String
  Text_ = Text
End Property
Property Let Text_(newValue As String)
  Text = newValue
End Property


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.