Solved

Pass Array to Class vb.net

Posted on 2014-04-17
2
517 Views
Last Modified: 2014-04-17
How do I pass an array into a class property in VB.NET?

For example, in my class I have the following code:

    Public Property GCArray() As String
        Get
            Return Me.cGCArray()
        End Get
        Set(value As String)
            Me.cGCArray() = value
        End Set
    End Property

Open in new window


cGCArray() is created when i  split a list of strings.
I'd like to be able to access each string when using the class like this:

textVar = myClass.GCArray(x)

I'm missing something - cause my code isn't working.  Any ideas?

Thank you for your help!!!
0
Comment
Question by:slightlyoff
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
Public Property GCArray() As String()

Open in new window


Add the parens at the end.
0
 
LVL 1

Author Comment

by:slightlyoff
Comment Utility
That was fast!  Thank you for your help!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now