Compound member attributes

Compound member attributes

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:

Property Get Text_() As String    Text_ = TextEnd PropertyProperty Let Text_(newValue As String)    Text = newValueEnd Property

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several