Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i change the below property into a function ?
its in vb6 and i want to convert it into vb.net .

Public Property Let PathToTop(pPathToTop As String)
lPathToTop = pPathToTop
Set lAttribute = Nothing
Set lAttribute = lDatabase.GetProperties(lPathToTop)
End Property

Public Property Get PathToTop() As String
PathToTop = lPathToTop
End Property


Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 4-Feb-13 4:16am    
Gibberish! And how can it help to "convert" anything to .NET?!
—SA
Zoltán Zörgő 4-Feb-13 4:17am    
A property is function. Actually one or two functions: a getter and/or a setter. What is your problem? It is not clear, please improve question.
saurabh kumar mahto 4-Feb-13 4:23am    
I just want this VB6 piece of code to be converted into VB.NET ?
can you please help me ?

1 solution

You would need two functions - one for the getter, and one for the setter.
So why not make it a property?
VB
Private lPathToTop As String
Public Property PathToTop() As String
	Get
		Return lPathToTop
	End Get
	Set
		lPathToTop = value
		lAttribute = lDatabase.GetProperties(lPathToTop)
	End Set
End Property
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900