473,385 Members | 1,875 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.

I know what I want but don't know how

What I am looking for is as follows:

I am sure you have seen where there are 2 list boxes side by side with
arrows pointing each way inbetween them. Then when you select something on
the left pane and click the right arrow in the middle, what you selected
moves over to the right pane and vice versa.

How is this done?
Is this "Split" on the tool box?

Can some one point me to a tutorial or send / explain the code?

Thank you in advance.
Nov 21 '05 #1
2 889
Jim,

If listbox1 has an item selected, then add the selected item in listbox1 to
listbox2 and remove the selected item from listbox1:

If ListBox1.SelectedIndex >= 0 Then
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.Remove(ListBox1.SelectedItem)
End If

Kerry Moorman
"Jim Campau" wrote:
What I am looking for is as follows:

I am sure you have seen where there are 2 list boxes side by side with
arrows pointing each way inbetween them. Then when you select something on
the left pane and click the right arrow in the middle, what you selected
moves over to the right pane and vice versa.

How is this done?
Is this "Split" on the tool box?

Can some one point me to a tutorial or send / explain the code?

Thank you in advance.

Nov 21 '05 #2

"Jim Campau" <ji********@bausch.com> wrote
What I am looking for is as follows:

I am sure you have seen where there are 2 list boxes side by side with
arrows pointing each way inbetween them. Then when you select something on
the left pane and click the right arrow in the middle, what you selected
moves over to the right pane and vice versa.

How is this done?
Is this "Split" on the tool box?

Can some one point me to a tutorial or send / explain the code?


It will probably be something like this:
Private Sub MoveItem(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

' Insert at destination's current selection point
If ListBox2.SelectedItem IsNot Nothing Then
ListBox2.Items.Insert(ListBox2.SelectedIndex, ListBox1.SelectedItem)
Else
ListBox2.Items.Add(ListBox1.SelectedItem)
End If

' Remove from source list
ListBox1.Items.Remove(ListBox1.SelectedItem)

End Sub
LFS
Nov 21 '05 #3

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

Similar topics

1
by: Laphan | last post by:
Hi All I know this is my 2nd (and final) cross-post, but which NG should I use for the below. I want to create a game that queries and updates text and numeric stats on a regular basis, so...
20
by: Simon Harvey | last post by:
Festive greetings fellow programmers! I've been programming now for about 4, maybe 5 years now. 4 of those years were at university so and I havent had much work experience of making real world...
20
by: Sam | last post by:
Hi I'm learning to code with C++ and wrote some very simple code. I think it's consistent with every rule but always got compiling errors that I don't understand. The code include 5 files as...
7
by: Dean Trower | last post by:
Does anyone know a clean method of preventing scrolling altogether in a TEXTAREA (i.e. ensuring the user CANNOT type more text than fits inside the box area)? I'd like to know how, if so... It...
1
by: Simon | last post by:
Hi everyone, I have a quick question that I hope someone can help me with: I've made a user control that contains a text box and some validation functionality. This control has a few extra...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
9
by: Coleen | last post by:
Hi All :-) I am desperately looking for some help/information on how to direct page flow. Forget what I have done - here's what I need to do: I have a large ASPX.Net - VB.Net web application...
102
by: BoogieWithStu22 | last post by:
I am running into a problem with a web page I have created when viewing it in IE6 on some machines. The page has a database lookup. The user enters an account name or number and clicks a lookup...
3
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework,...
7
by: devnew | last post by:
hi i am trying to create a cache of digitized values of around 100 image files in a folder..In my program i would like to know from time to time if a new image has been added or removed from the...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.