We help IT Professionals succeed at work.

Handling events for controls within a programmatically added User Control

si2030
si2030 asked
on
Medium Priority
194 Views
Last Modified: 2012-08-13
Hi Experts,

I have a user control that has a combobox in it called cbxClientLIst.

The user control is added to a group box on a form programmatically. (see Below).

I want to fill a cell in a datagridview with the details of the selected value once a user leaves the user control combobox... essentially manage an action.

How do I write a handler that fires when the user tabs off the combobox? ..so when they tab off I can take the contents of the combobox and add it to another control....

Kind Regards
Simon
Me.grpInvoiceDetail.Controls.Add(thisUserControl)
        thisUserControl.Location = New Point(339, 16)
        thisUserControl.TabIndex = 0
        thisUserControl.cbxClientList.Focus()

Open in new window

Comment
Watch Question

Commented:
you can use AddHandler to handle events from a control
http://msdn.microsoft.com/en-us/library/7taxzxka(VS.80).aspx

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks.. now have that working.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.