Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
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
Sergey Alexandrovich Kryukov at 4-Feb-13 4:16am
Gibberish! And how can it help to "convert" anything to .NET?! —SA
Zoltán Zörgő at 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 at 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
Your Filters
0 Shai Vashdi 1,858
1 OriginalGriff 278
2 Tadit Dash 260
3 Sergey Alexandrovich Kryukov 250
4 Peter Leow 220
0 Sergey Alexandrovich Kryukov 9,440
1 OriginalGriff 5,618
2 Peter Leow 4,280
3 Maciej Los 3,540
4 Abhinav S 3,363

Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid