problem in catching the keys pressed on combo box

  • Thread starter Thread starter Nagachandra Sekhar Grandhi
  • Start date Start date
N

Nagachandra Sekhar Grandhi

I placed a combobox control on User control and this user control was placed
on a form and I tried to catch the keys pressed on that combo box, but I am
unable to do it. I set the property of keypreview to true.
But when I do the same for text box it is working fine.



After that I placed the combo box control on the form itself and done the
same then also I wasn't able to get the keys pressed on that control. Is
this problem with the combo box control in .NET?
 
The keypress event of the combobox is called but in the scope of the User
control.
I had the same problem, so in my event handler for the keypress event (on
the user control) I
raised another event (my custom event) to which the form was subscribed
to...

One other thing... If you are going to have just one combobox or textbox on
the User control it really doesn't
pay to use it... Make "MyComboBox", which inherits from ComboBox...

saso
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top