Link to home
Start Free TrialLog in
Avatar of AntonioRodrigo
AntonioRodrigo

asked on

ComboBox programmatically take focus away

Hello,

I am using WIndows Forms. I have a ComboBox control on my form. I want programmatically take away focus from my ComboBox, so it is no longer selected.

In fact, I am using a DataGridView with custom column - when in edit mode, ComboBox appears. My real problem is that when I select row header, edited ComboBox remains selected, but I need to select row and un-select every cell in that row. And idea how to get focus away from ComboBox?

Please note: my custom column is not of type DataGridViewComboBoxColumn - it's completely customized and when in edit mode, ComboBox appears in the cell.


Greetings, Frenky
Avatar of raysonlee
raysonlee

I suppose dgv.endedit() will end the edit mode but not losing focus. How about dgv.currentcell = nothing or set it to another cell?
ASKER CERTIFIED SOLUTION
Avatar of raysonlee
raysonlee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial