Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2005

Tip: Looking for answers? Try searching our database.

ListBox Transfer Sample Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sivana - 31 Jul 2005 19:40 GMT
Hey,

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

Thanks
Sivana - 31 Jul 2005 21:56 GMT
> 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?
Martin Peter Hanke - 31 Jul 2005 22:00 GMT
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

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.