[RESOLVED] Help with variables
So I've been trying for TOO long with this now, i really need some help..
I'll try to explain..
I want to "Dim" a command, so that when i want to use the "command" (which is "button1.location" I just want to enter button =
I also want to take the text from a string and put it after "="
Example of how it looks like in my brain... :
Code:
Dim button as string = "button1.location"
Dim box as string = "box1.location"
button = box
This is so that i can create a private Sub and use the Call command instead of typing the same code.. There really should be some way to do it
Help....
Edit: What. The. Hell. Why did it just work.. Ignore the Newb.
Re: [RESOLVED] Help with variables
Have a look at this page, it explains .Location
You do not need
Code:
Dim button As String = "button1.Location
you need something more like
Code:
Button1.Location = New Point(100, 200)
The numbers 100 and 200 are pixels measured from the Left and Top respectively of the container that the button is in. This will probably be the form itself in this case.