vb.net 2005 - addhandler for dynamic controls
Posted on 2007-11-28
Okay, I have two comboboxes - clicking the first runs code to populate the 2nd.
Now, I've recently adjusted my code to basically duplicate those combo boxes at run time.
I think I've got the addhandler right:
AddHandler cbo.SelectionChangeCommitted, AddressOf cboCat_SelectionChangeCommitted
But how can I alter the sub so that it accepts any caller and updates the callers related combo?
Private Sub cboCat_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboCat.SelectionChangeCommitted
PopulateDetails() 'Fairly sure I'll just need to pass the controls name as a combobox to this sub...
cboCatDetails.Visible = True