Click here to Skip to main content
12,954,203 members (53,573 online)
Rate this:
Please Sign up or sign in to vote.
See more:
how can i change the below property into a function ?
its in vb6 and i want to convert it into .

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

Posted 3-Feb-13 22:15pm
Gibberish! And how can it help to "convert" anything to .NET?!
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,464
CHill60 3,490
Maciej Los 3,123
ppolymorphe 2,020
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100