Pointing/referencing to a variable

How do you refer to a variable through a variable.

I have a very small example, just download it, modify the project then upload to help or you can just write some code and an explanition, either way should help.

link text

Thanks lots

I took a quick peek at your project, but I have no idea what you are trying to accomplish.

Your project doesn’t compile because of an error in SelectedListBox.Set, which, because of the way you implemented the Get, does not need to have any code in it at all anyway.

I think the OP wants to reference a control set of listboxes (ListBox1) by the currently active tab of their containing tab panel. Tab 0 contains the zeroth listbox in the control set, tab 1 contains the first, etc.

I think the intention is to switch tabs based on which index in ListBox1 is assigned in SelectedListbox.Set. If so, this will work:

Set(Value As ListBox) TabPanel1.Value = value.Index End Set

Calling it like this:

SelectedListbox = ListBox1(0) ' select zeroth tab/listbox

[quote=15367:@Andrew Lambert]I think the OP wants to reference a control set of listboxes (ListBox1) by the currently active tab of their containing tab panel. Tab 0 contains the zeroth listbox in the control set, tab 1 contains the first, etc.

I think the intention is to switch tabs based on which index in ListBox1 is assigned in SelectedListbox.Set. If so, this will work:

Set(Value As ListBox) TabPanel1.Value = value.Index End Set

Calling it like this:

SelectedListbox = ListBox1(0) ' select zeroth tab/listbox

Thanks. This really helps.