Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27365

[RESOLVED] Accessing Objects?

$
0
0
I was wondering if it is possible to access an object VIA strings, for example...

I have a PictureBox with the name "PictureBox1"(Just an example), so accessing it would be simple as follows.
Code:

PictureBox1.BackColor = Color.Orange
Is it possible to access the PicturedBox by using strings or any other way to return the object with strings like this:
Code:

Dim a As String = "Picture"
Dim b As String = "Box"
Dim c As String = "1"

Dim pb As PictureBox = SomeFunction(a + b + c)
                      'Returns the PictureBox1

pb.BackColor = Color.Orange

Or is there any function that already exists to do this that I just don't know about?

Viewing all articles
Browse latest Browse all 27365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>