Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX Control Set Property Comment/ Attribute 1

Status
Not open for further replies.

MattSTech

Programmer
Apr 10, 2003
333
US
Hello to all,

I am creating an ActiveX control. I have created custom properties using Get/Let. When I add the compiled control to a new project (.exe project) I can use my nifty little properties but there is one little hang up. They don't have any comments attached. I would think someone using this control would be confused if I didn't have such witty names like "Border_Color" for the properties.

I started a wizard control and changed the description (comment) for the property to see if I could get the wizard to give me the code to do this. It didn't, at least, nothing I could put into my code. But the description I modified had to be somewhere so I opened up the .ctl as text and woohoo:

Code:
Public Property Get Border_Color() As SomethingorOther
Attribute Appearance.VB_Description = "SuperCool Description."
    Border_Color = vbHotpinkwithalittlemagenta
End Property

Unfortunately this attribute is invisible during design in the IDE.

So, after a long winded description of my problem. Is there a better way to get custom definitions into my properties besides a manual edit outside of the IDE?

Matt
 
Also,

please note that you can actually paste this into your code (It will appear red as if it is a bad statement), save your project and reopen and it will have disappeared (and worked).

I would just think that there is a more elegant method.

Matt
 
Attribute [BOLD]Appearance[/BOLD].VB_Description = "SuperCool Description."

The word highlighted above must be changed to your Property name. It should read [BOLD]Border_Color[/BOLD] for my example.

Do you think if I reply enough to my own thread that I will eventually come up with the answer:)
 
Is there a better way to apply these attributes?
 
Set the focus to your UserControl's code window, then select Tools/Procedure Attributes

You should now be able to select any of your UserControl's methods and properties by name, and edit their descriptions to your heart's content
 
Thanks, I searched through the help and only saw how to set them using the wizard. I must have missed it somewhere.

Thanks again.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top