Dll Properties

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Dll Properties
hungryhounduk
Hi Guys and Gals

It's been a long time since i made my own .dll files and I am thinking of getting back into making them.

Now my Question is,

With the normal VB Component you have the Properties Window , where you can change the look and certain elements of the Component...

How do I initiate that for a .dll file that i make myself?

I know I can add code to my .dll to change Properties at Runtime, But how do i make a .dll that when loaded into VB in the ToolBox and then dragged onto my Form, I can adjust it's properties in the Properties within VB? before I compile it..

As I said it's been a longtime since I made my own .dll files, So i might be Barking up the wrong tree, so to speak.

But any Help would be most Gratefull

Cheers

Chris
Image
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Dll Properties
comathi
If your DLL inherits from a pre-existing control, you'll see all those properties in the properties window when you drag the control on your form.

Are you talking about adding custom properties to your dll?
User avatar
visualtech
VIP - Donator
VIP - Donator
Posts: 265
Joined: Sat Nov 19, 2011 2:19 pm

Re: Dll Properties
visualtech
If it's a custom property, adding one is super easy. See the code below
Code: Select all
Private _example As String = ""
Public Property Example() As String
    Get
        Return _example
    End Get
    Set(ByVal value As String)
        _example = value
    End Set
End Property
That should do it. However, if you want a property category; add this just above the line
Public Property
Code: Select all
 
<Category("CategoryName")>
Public Property Example() As String
...
Category Attribute. BTW: A category is the group under which a property appears in the Property Panel.

I guess that should satisfy your need. And remember that any Public property will be visible in the Property Inspector under the Misc. category.
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Dll Properties
hungryhounduk
Hey
Thanks Comathi andVisualTech, I will try that out

Cheers

Chris
Image
4 posts Page 1 of 1
Return to “Coding Help & Support”