HOW-TO Initialize expanded properties?
Do you need something made? then ask 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.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts
Page 1 of 1
Hey, I'm working on a project and i need to initialize an expanded property like this:
Code: Select all
But here is the error
Public Property Words As String() = {"Bla","Bla"}
Get
Return Words
End Get
Set(ByVal value As String())
End Set
End Property
Code: Select all
Help me out of this mess guys, giving rep to the ones who help!Public Property Words As String() = {"Bla","Bla"} <--- You cannot initialize expanded properties
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

The idea is to store the current value as a seperate variable outside of the property block:
Code: Select all
Dim starting As String() = {"Bla", "Bla"}
Public Property Words() As String()
Get
Return starting
End Get
Set(ByVal value As String())
starting = value
End Set
End Property
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023