Is there a way to give a value to multiple variables (integers in this case), instead of all at once?
For instance, I have Dim aceVal, twoVal, threeVal, fourVa
You could use an array/dictionary like so:
Dictionary myValues = new Dictionary();
myValues.Add("FirstVal", 1);
myValues.Add("SecondVal", -1);
myValues.Add("ThirdVal", 1);
You could then write a simple function:
public updateMyValues(string[] myKeys, int myValue)
{
foreach (string s in myKeys)
{
myValues[s] = myValue;
}
}
And finally when your list box changes you could just call the function to update the variables you want like so:
upDateMyValues({"FirstVal", "ThirdVal"}, -1);
Hope this helps.
*Edit: I know it's in C#, but it's easily portable to VB.