Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

[SOLVED] Adding From Combobox To Listbox Visual Basic

Adding from combobox to listb combobox

  • This topic is locked This topic is locked
5 replies to this topic

#1 itspecialist

itspecialist

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 25 April 2012 - 10:01 AM

Can anyone help me with this. I am trying to add to a lsitbox from a combobox removing from the combobox the added listbox items.

Trying this...

lstCourses.Items.Add(cbbCoursesPR.SelectedItem)
cbbCoursesPR.Items.Remove(cbbCoursesPR.SelectedItem)
lstCourses.Items.Add(cbbCoursesPR.SelectedItem)
cbbCoursesPR.Items.Remove(cbbCoursesPR.SelectedItem)

Thank you all.
  • 0

#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 25 April 2012 - 07:31 PM

And that didn't work ?
you might need to RefreshItems() and refresh() the controls after doing the remove() and Add() on a previously drawn screen.

First one refresh the items, the second one redraws the control.

Feel free to ask anything.

by curiosity's sake, any reason for not doing the well known list to list way ?
  • 0

#3 itspecialist

itspecialist

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 25 April 2012 - 07:48 PM

1. Did not work.
2. I will try tomorrow and I let you know if works.
3. I am new with this and I have no idea about the "list to list way" ? Can you explain or redirect me to the best source of good information?

THANK YOU!
  • 0

#4 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 25 April 2012 - 08:28 PM

Oh, its just why you are doing but instead of list -> combobox it will be list <-> list , so what you pick from one pass to the other,
i will find some sample ...

Visual basic samples

VB NET samples

Some youtube tutorial

happy coding !
  • 1

#5 itspecialist

itspecialist

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 26 April 2012 - 06:14 AM

I fix the problem. I was duplicating the code so it was looking to add something that was no loinger there. Silly mistake.


Thanks for all your help.
  • 0

#6 Roger

Roger

    Skadoosh!

  • Administrator
  • 1222 posts
  • Programming Language:C, PHP
  • Learning:Others

Posted 06 May 2012 - 04:11 PM

This topic has been marked as SOLVED. If you have a similar topic, please start a new thread and reference this thread to continue discussions.
  • 0

New around here? Click here to register and start participating in under a minute?

Or do a quick search and you may find the answer you're looking for.






Also tagged with one or more of these keywords: Adding from combobox to listb, combobox

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download