|
-
May 7th, 2013, 12:28 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Adding Events To Custom Controls
I have a custom control that has a series of comboboxes. In my application, I programmatically add the control to several programmatically created tabs. When the first combobox value is changed, I would like to iterate through each of the controls and set their value to match. I know how to iterate through the tabs and find a particular combobox within each control, but I haven't been able to figure out how to assign an event to those comboboxes to trigger the search in the first place.
How does one assign an even to a subcontrol within a custom control?
-
May 7th, 2013, 12:33 PM
#2
Re: Adding Events To Custom Controls
Its very easy. Use AddHandler.
-
May 7th, 2013, 12:35 PM
#3
Thread Starter
Hyperactive Member
Re: Adding Events To Custom Controls
I've used AddHandler on a programmatically created standard control, but how would I do that with MyCustomControl.ComboBox1? Loop through the control at creation, find the Combobox and add it that way?
-
May 7th, 2013, 01:00 PM
#4
Re: Adding Events To Custom Controls
The custom control would have a public Controls property which would give you a collection of all the controls on its surface. Use that in combination with AddHandler.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|