473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Basic Problem with a listbox control

Hello,

I am having a problem with 2 listboxes on a form. there are 5 items in
the 1st listbox and if i click the first item i want a value to show
up in the second listbox . This is working fine, but if i click it
again, that value shows up again in the second listbox underneath the
'o' index. how do i stop this?

this is the code:

If packageListBox.SelectedIndex = 0 Then
interiorListBox.Items.Insert(0, "Fragrance")
End If

thanks for ur help
Bharath

Apr 21 '07 #1
2 890
Gunnu <bc******@gmail.comwrote in news:1177185878.906861.243220
@p77g2000hsh.googlegroups.com:
Hello,

I am having a problem with 2 listboxes on a form. there are 5 items in
the 1st listbox and if i click the first item i want a value to show
up in the second listbox . This is working fine, but if i click it
again, that value shows up again in the second listbox underneath the
'o' index. how do i stop this?

this is the code:

If packageListBox.SelectedIndex = 0 Then
interiorListBox.Items.Insert(0, "Fragrance")
End If

Clear the lsit prior to inserting the new item.

Apr 21 '07 #2
Maybe write a little code to check for the existance of the entry in List2
before it is added to the list. If it exists then don't add it again.

"Gunnu" <bc******@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
Hello,

I am having a problem with 2 listboxes on a form. there are 5 items in
the 1st listbox and if i click the first item i want a value to show
up in the second listbox . This is working fine, but if i click it
again, that value shows up again in the second listbox underneath the
'o' index. how do i stop this?

this is the code:

If packageListBox.SelectedIndex = 0 Then
interiorListBox.Items.Insert(0, "Fragrance")
End If

thanks for ur help
Bharath
Apr 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ericm1155 | last post by:
I am trying to display some information from a database in a form that displays one record per line. When the user clicks anywhere on a line, that record is highlighted and selected, and my program...
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
4
by: Moe Sizlak | last post by:
Hi There, I am trying to return the value of a listbox control that is included as a user control, I can return the name of the control but I can't access the integer value of the selected item,...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.