help in listbox having conflict with keypress

ljpv14

Active member
Joined
Nov 28, 2011
Messages
44
Programming Experience
3-5
Hello! I've been encountering this problem. When I add a listbox at my game, all my keypress events and codes doesn't work. But when I remove it, it will work again. I don't know what's the problem. I need the listbox to add strings on it for my game. I REALLY NEED HELP!
 
I'm guessing that you are handling those events for the form. By default, when a child control has focus, the form does not raise keyboard events. In order to change that behaviour, set the KeyPreview property of the form to True.
 
I kind of made this work by disabling first and when I need to add some items to it, that's the time I'm going to enable it then disable it again. I think that would be fine. Anyways, thank you for your time explaining it to me. Additional knowledge for me. Thanks! :D
 
Back
Top