Question How to avoid the closing of a custom combo box popup window in a custom datagrid?

justinemathew

New member
Joined
Jan 31, 2012
Messages
2
Programming Experience
3-5
I was trying to block the closing of a custom combo box popup window in my custom DataGrid. The popup window comes by pressing F4 or ALT+DOWN keys in my datagrid which is getting closed if I press the down arrow for the first time, after showing the first value in the combo box as selected. Next time onwards, if I press the F4 key and down arrow, I can move to any item in the popup window and select the item using keyboard and in that case, the popup window is not getting closed till I press the ENTER key or selection using the Mouse. Is there any specific reason for this behaviour or something is missing in my code part? Expecting your help.
 
Just so that we're clear, are you really using .NET 1.1 and a WinForms DataGrid control?
.Net is 1.1 only and the Data grid as well as Combo box are controls created by inheriting the actual dot net controls.



Public Class myDataGrid Inherits DataGrid and


Public Class myGridComboBox Inherits ComboBox




onkeypress, onkeydown, ProcessCmdKey methods are there in the myGridComboBox class.

Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
End Sub

Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
End Sub

Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
End Function
 
Last edited:
Back
Top