Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

add from listbox to listbox in seperate forms

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so i have 3 forms. 2 of which are populated and i need to take the selected items from those listboxes and add it to the main which is empty. so this is what i have. I have no errors but it also does nothing. any help will be appreciated.

this is the form that contains the empty listbox.


and this is one of my populated listboxes that i'm trying to remove items from there and add them to the main listbox.



i believe my problem is in line 8 of my second form. I have it as New MainForm. which i assume is creating a new form as it implies. i want to modify the current form that is already being displayed. I'm not sure what to put there instead of new though since i really just want to modify it.
 
Rob Frank
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so i fixed it half way. i can have it add items like i need. no problem there. however i want it to also remove the items from that list box as they are added to the next. what i have is.



if i add this i get Exception thrown: 'System.InvalidOperationException' in System.Windows.Forms.dll




 
Rob Frank
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i guess i'm just posting this for anyone searching the web for the answer like me lol. took me awhile to find out how to do this.  but here it is.


 
Rob Frank
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so i'm still on this for anyone who cares. I cannot get my numbers to populate in my labels. I just get zeros. I have inserted breakpoints and i can't figure this out....

main form


second form


third form


and a module containing the variables and functions



I'd really appreciate any help as always. One note I should be able to get a count going instead of using the for loop. but either way i can't make that work. I run the program and intTotal = 0 decSub=0 and so on. No errors are found. And sorry for the lack of comments. I should be doing them as i go but i've gotten so frustrated i've been deleting and changing stuff all over the place.
 
Rob Frank
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well my problem is in my  module. my function calcSub() . I'm trying to search the cart items for my loop. however i have never done this before and it would appear that  using ".Contains" is not the correct way to go. It does not pick up anything in my cart items. I have tried



and
and


can't make anything of that really do anything.
 
reply
    Bookmark Topic Watch Topic
  • New Topic