Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I close the current editor after user hits the ENTER key?

editor enter hits key user
0
Posted

How do I close the current editor after user hits the ENTER key?

0

The EditClose method closes the current editor, if the control is running in the edit mode. Use the Editing property to determine whether the control runs in the edit mode. The following sample closes the current editor if the user presses the ENTER key: Private Sub Grid1_KeyDown(KeyCode As Integer, Shift As Integer) With Grid1 If not (.Editing = 0) Then If (KeyCode = 13) Then .EditClose End If End If End With End Sub The Form_Load event can look like follows Private Sub Form_Load() nChanging = 0 nChanging = nChanging + 1 With Grid1 .BeginUpdate With .Columns.Add(“Column 1”).Editor .EditType = EXGRIDLibCtl.EditType End With With .Items .AddItem 1 .AddItem 2 End With .EndUpdate End With nChanging = nChanging – 1 End Sub In C++ the KeyDown handler looks like follows: void OnKeyDownGrid1(short KeyCode, short Shift) { if ( m_grid.GetEditing() ) if ( KeyCode == VK_RETURN ) { m_grid.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123