First of all, yes this is for an assignment. I need to know HOW to do this so that I can perform this operation in the future. I have two list boxes that I am sending the data selections to ONE text box. My problem comes along when I am ready to perform the calculation of randomly chosen (by random user) parts. There are 6 choices in one box and 5 in another.

I know there has to be a simple calculation to tell my program how to "grab" the information from the text box, but I don't know how to assign a VALUE to the listboxItem() selection within the text box.

If I could only assign the value somehow, I think I could discover a way to get the calculation. Should I setup an Array (though we weren't taught arrays in this particular class) or should I set the value and 'DIM' the variables as Integer instead of string when passing them to the text box?

My question may not be clear enough for anyone to answer because of my own frustration and confusion at this point but I will attempt to clarify if need be.

Thanks in advanced for anyone's attempt at answering my dilemma. :)

8 Years
Discussion Span
Last Post by finito

I don't have a compiler atm,

But it would look something like this.

textbox1.Text = ListBox1.SelectedItem

As for how you initiate the transfer from the listbox to the text box.

You have to ways, code it to a button or use the SelectedIndexChanged Event


That actually really helps. I am not quite "there" on my coding, but it gets me closer to the "starting" line. We are to use a button to activate the event. I just couldn't get a hint of where to get a general idea of calculating without writing lines and lines of hard coding for calculating these choices.

Thanks so very much for the nudge!!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.