Pls help with listbox code.

preeti164

Member
Joined
Oct 27, 2008
Messages
7
Programming Experience
Beginner
I have three list boxes(shufflebox)
I want to transfer users from lstBox1 to lstBox2 and lstBox3.But i want to limit the number of users transfered from lstBox1 to lstBox2 and lstBox3 to 10.What should be the code to transfer total 10 users combined lstBox2 and lstBox3.Also want to display a message "You cannot transfer more then 10 users".
 
You can check the count (listbox.Items.Count) before making the transfer, in this case you have two counts to add together to see it the number is 10.
 
Can you please give me the code for combined count and also don't i need a loop to check if it's greater then 10 then exit?
This question I cut from the visitor messages of my forum profile page. Do you really think that is an appropriate place to reply to a thread? Really??

Here is the answer, but what you really need to do is start reading a beginner book in VB.Net programming.
VB.NET:
Dim combinedcount As Integer = lb1.Items.Count + lb2.Items.Count
 
Back
Top