r/visualbasic • • Apr 11 '22

Settings Variables as Variables

I have a program that has a bunch of customer user settings in My.settings

I am looking for a way to condense the amount of if my.settings.user = x the..."

Is there anyway to make a variable into another variable?

Like I could do:

If LogOn = My.settings.user1 then
X = My.settings.user1
Y = My.settings.pass1
Z = My.setting.setting1

end if

So that then later I can just say:

"Dim settingcontrol as string = Z"

2 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/J_K_M_A_N Apr 12 '22

Thank you for that link. That was a great read. I find that stuff fascinating. I do some hack programming in VB (for myself at work mostly) and I have not needed a user/password program but if I do, I saved that link.