Hey,
Thanks for the reply. I added a raiseEvent in my composite control and it looks like this:
Public Event DeleteItem(ByVal itemID As Integer, ByVal CustomerID As String, _ ByVal Index As Integer)
Private Sub lknDelete_LinkClicked(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) _ Handles lknDelete.LinkClicked RaiseEvent DeleteItem(_Item.ItemID, _CustomerID, _Index) End Sub
-----
Im new to this concept so I dont know if this is the most efficient way of doing this... _Item.ItemID is the item number of the item I want deleted from database. _CustomerID is the customer ID number associated to the item to be deleted. _Index is the index number of the control array I use.
-----
Now in my parent form I have my control array of the composite control. That works great. Let say I have 3 items in the "cart" for a customer and I want to delete one. I am passing in the ItemID, CUstomerID, and index of control array to be deleted.
I assume the best place to execute this code is in the parent form. That way I have both the add and delete methods for the control array together.
This is where it gets confusing for me. I want to call the delete function to remove the item from the database.
So, in my composite control, I have the code above. When the link label is clicked I am raising the event DeleteItem() and passing in the itemID, customerID, and Index.
Now, how would I catch that event in its parent form?
Thanks, Gregg |