473,320 Members | 1,823 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,320 software developers and data experts.

ListBox Transfer Sample Code

Hey,

Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.

Thanks

Nov 17 '05 #1
2 2452
> Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.


In fact, I'm using a database and dataviewmanager. I've populated an
"available" list box. I've also populated an "assigned" list box.

I would like to create some buttons to transfer (either copy or move) items
to and from the list boxes.

However, I'm not sure how I'm suppose to manipulate the dataviewmanager.

Does anyone have some sample code?
Nov 17 '05 #2
Hi,

since I was short on time in my last project, I did an quick and dirty
approach:

ArrayList arItems;

void CreateMyItems()
{
lvi = new listviewitem();
// Do all the needed stuff here

arItems.Add(lvi);

FillMyView(arItems);
}
So each form had the FillMyView(ArrayList al) func and it works great.
The only trouble is if you need to modify the items on one form but keep
the old data in the other form. I'm not sure, but there was some issue
about one of those "passing my items"-thing.

Hope this helps,

Martin

Sivana wrote:
Hey,

Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.

Thanks

Nov 17 '05 #3

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

Similar topics

2
by: PC User | last post by:
I'm creating a shortcut menu to popup over my richtext box. Its a form with a listbox of menu items with associated richtext activex (rtf) editing commands. I found a way to transfer a value from...
2
by: mathieu cupryk | last post by:
I have problems with listboxes in the webform2.cs, the textboxes are working well when I do a click on next. I am missing something. It works with the textboxes. Here is the file: using System;...
1
by: mlarson | last post by:
Hello, I'm working on a page that dynamically creates listboxes and the "options" that are added to the listbox. A user can then click on buttons to either add or delete the "options" from one...
1
by: ?+? | last post by:
<form name="form1" id="form1" runat="server"> <asp:ListBox ID="ListBox1" DataSource="<%# SelIndex.DefaultView %>" DataTextField="tblIndexDesc" DataValueField="tblIndexCode" runat="server"...
3
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
28
by: cjobes | last post by:
Hi all, I need to populate a listbox from a table column. The column has multiple entries of usernames and I need to pull a unique set of usernames. The table is part of an untyped Dataset that...
10
by: Ben | last post by:
Hi Im trying to get the value from a listbox, i have the below code to get the text: txtEntity.Text = ListBox1.Text But do not seem to be able to retrieve the data that i set as the value...
7
by: tonsam | last post by:
I am planning to create a form (Issuance) where all the records of the subform will be selected from the listbox. The listbox is not part of the main and subform but will only be visible upon...
8
by: sbandalli | last post by:
Hello All, I have a tabcontrol control , In the tabpage1 I have listbox with some items, and in the tabpage2 I have a combo box, How to transfer the items(all the items) from the Listbox in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.