472,371 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Moving collection object between text boxes and saving value on index change?

Disclaimer: I'm a newbie that's been working with VB.net for under a
month.

I have two listboxes. Listbox1 contains collections. Selecting an item
in listbox1 and pressing a control button sends the collection to
Listbox2. When the item is in Listbox2 it you are able to edit the
collections properties via textboxes that appear using the
flowlayoutpanel.

All of this works fine as long as the same collection doesn't appear
twice in Listbox2. For instance if Listbox1 contains the collection
Spices and Sweetners for use in a recipe, if Spices appears in Listbox2
more than once (i.e. using more than one spice in the recipe) the
values entered for one spice collection are copied to every other spice
collection in Listbox2. I want to be able to have two collections of
the same type in Listbox2 with each being able to have their own unique
values.

I think the problem is in Sub ListBox2_SelectedIndexChanged

Here is my code:

************** Begin Code **************
Private Sub ListBox2_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ListBox2.SelectedIndexChanged
Dim ingredient As ingredientlist
ingredient = Me.ListBox2.SelectedItem
FlowLayoutPanel1.Controls.Clear()
Dim ingprop As ingredient
Dim lbl As Label
Dim txtbox As TextBox
Dim setbutton As Button
For Each ingprop In ingredient.propertyList
lbl = New Label()
lbl.Text = "Property"
FlowLayoutPanel1.Controls.Add(lbl)

txtbox = New TextBox
txtbox.DataBindings.Add("Text", ingprop, "name", True,
DataSourceUpdateMode.OnPropertyChanged)
Me.FlowLayoutPanel1.Controls.Add(txtbox)

setbutton = btn_setval
FlowLayoutPanel1.Controls.Add(setbutton)

FlowLayoutPanel1.SetFlowBreak(setbutton, True)

Next
End Sub

************** End Code **************

Thanks for all your help.

-Blake

Jul 31 '06 #1
0 984

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

Similar topics

16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
38
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please...
2
by: Cider123 | last post by:
Trying to figure out how to replicate the same interface as what a ListView control has. I have everything working for the most part, with exception of 1 minor setback. I can't seem to pass...
10
by: Kathy Burke | last post by:
HI. in asp.net app, I have an xmlDocument that I transform to the client html. Using xsl I create a few textboxes to capture user input. Each of these are related to <data> elements in the xmlDoc....
3
by: jason | last post by:
Hello. I've got this simple collection populate code I downloaded from the net (sorry can't find source now) I'm trying to test, but I can't seem to get it to work. Any help would be greatly...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
1
by: Ruben | last post by:
I have a collection (PersonCollection inherits collectionbase and implements ITypedList it's a collection of Person objects) this collection also implements the IComponent interface, so I can drag...
6
by: Matt | last post by:
I'm not entirely sure how to describe this issue. I have a number of ComboBoxes in my application which have their text properties bound to a field in a data set. The items loaded in the ComboBox...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.