Well, you don't say much about what you are trying to accomplish. But this may be one possible way:
if List1.ListIndex = 0 then Text1.Text = "6.14"
if List1.ListIndex = 1 then Text1.Text = "5.04"
ListIndex gives you the rows in the list. First row = 0
It seems this could be done alot better though, but I guess you are just playing around to learn? This way the software must be listed in the same order every time. If they are not then you must check the value on the row to know what to display in the text box. Like:
if List1.Text = "Nero" then Text1.Text = "5.04"
Even this might not be so practical since you must hard code your data all over the code. You might want to learn to define a string array of software names and their versions. Then all the data is typed in at one place. Then on load you populate the list with the names from the array, and on click you display the version from the array.
Eventually you will find that the only practical way is to have a database. But that is only if you get serious with this application.
|