473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dll custom properties

Hello,
I am a long time VB6 user, and am trying to make a VB.Net DLL. I am having
one problem using the new language, how do I add custom properties to a DLL?
The properties that a user can adjust at design time.

Thanks!
Bryan
Nov 20 '05 #1
4 1404
Hi Bryan,

What exactly do your mean by custom Properties? If you mean object properties, then it is just like in Vb, with a slightly different syntax.

Public Property MyProperty()
Get

End Get
Set(ByVal Value)

End Set
End Property

Regards,
Anand
VB.NET MVP
http://www.dotnetindia.com
"Bryan V." wrote:
Hello,
I am a long time VB6 user, and am trying to make a VB.Net DLL. I am having
one problem using the new language, how do I add custom properties to a DLL?
The properties that a user can adjust at design time.

Thanks!
Bryan

Nov 20 '05 #2
VB.NET is object oriented and requires that properties are members of a
class. You will create a class as a container for the properties and declare
them in much the same way.

Generally, a class with properties must be instantiated before the
properties can be used so you might do something like....

public class MyClass

private _int as Integer

public property MyInt as Integer
get
return _int
end get
set(byval value)
_int=value
end set
end property

end class

In your application that uses the DLL you create a new instance of "MyClass"
and adjust it's properties...

Imports MyDllNamespace

public class someclass
'create an instance of the class and hence it's properties
private c as MyClass=new MyClass()

public sub someSub()
'use the class properties
c.MyInt=10
end sub
end class

You can create classes that have static or shared properties. These don't
require an instance of the containing class and can be used as global
variables. I guess this was what you are referring to when you asked the
original question. Although this works, it's not a particularly good design
practice and you should begin thinking more in object-oriented terms where
properties are members of classes that have a lifetime.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"Bryan V." <ch***********@hotmail.com> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
Hello,
I am a long time VB6 user, and am trying to make a VB.Net DLL. I am having
one problem using the new language, how do I add custom properties to a DLL? The properties that a user can adjust at design time.

Thanks!
Bryan

Nov 20 '05 #3
* "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> scripsit:
Generally, a class with properties must be instantiated before the
properties can be used so you might do something like....

public class MyClass

private _int as Integer

public property MyInt as Integer
get
return _int
end get
set(byval value)

^^^

'... As Integer'.

:-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
Sorry.. C# programmer disease :-)

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OX**************@TK2MSFTNGP10.phx.gbl...
* "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> scripsit:
Generally, a class with properties must be instantiated before the
properties can be used so you might do something like....

public class MyClass

private _int as Integer

public property MyInt as Integer
get
return _int
end get
set(byval value)

^^^

'... As Integer'.

:-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
6
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without...
7
by: John Grandy | last post by:
My ASP.NET Web Service project has a Web Method that returns an array filled with instances of a custom class. The custom class is defined in a Class Library that is included in the web-service...
0
by: Pavan | last post by:
My name is Pavan and I am a software engineer working on ASP .Net web development. Currently I am using .Net 2.0 Professional Edition to develop my web pages. I have a problem
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
0
by: Giorgio | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older...
8
by: a | last post by:
I'm trying to save data from a custom object into the profile object, but it is not structured the way that I want. I'm trying to get the custom object to serialize as xml to a Profile object...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
4
by: Suresh | last post by:
Is there any way to access the custom properties of a master page from the aspx form? I know the custom properties of a master page can be accessed from the aspx.cs partial class by specifying...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.