event EditOpen ()
Occurs when edit operation starts.

 TypeDescription 

Use the EditOpen event to notify your application that the cell's editor is shown and ready to edit the cell. The Editing specifies the window's handle of the built-in editor while the control is running in edit mode. The EditingText property returns the caption being shown on the editor while the control runs in edit mode.

The edit events are fired in the following order:

  1. Edit event. Prevents editing cells, before showing the cell's editor.

  2. EditOpen event. The edit operation started, the cell's editor is shown. The Editing property gives the window's handle of the built-in editor being started.

  3. Change event. The Change event is fired only if the user types ENTER key, or the user selects a new value from a predefined data list.

  4. EditClose event. The cell's editor is hidden and closed.

Syntax for EditOpen event, /NET version, on:

private void EditOpen(object sender)
{
}

Private Sub EditOpen(ByVal sender As System.Object) Handles EditOpen
End Sub

Syntax for EditOpen event, /COM version, on:

private void EditOpen(object sender, EventArgs e)
{
}

void OnEditOpen()
{
}

void __fastcall EditOpen(TObject *Sender)
{
}

procedure EditOpen(ASender: TObject; );
begin
end;

procedure EditOpen(sender: System.Object; e: System.EventArgs);
begin
end;

begin event EditOpen()
end event EditOpen

Private Sub EditOpen(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditOpen
End Sub

Private Sub EditOpen()
End Sub

Private Sub EditOpen()
End Sub

LPARAMETERS nop

PROCEDURE OnEditOpen(oGrid)
RETURN

Syntax for EditOpen event, /COM version (others), on:

<SCRIPT EVENT="EditOpen()" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function EditOpen()
End Function
</SCRIPT>

Procedure OnComEditOpen 
	Forward Send OnComEditOpen 
End_Procedure

METHOD OCX_EditOpen() CLASS MainDialog
RETURN NIL

void onEvent_EditOpen()
{
}

function EditOpen as v ()
end function

function nativeObject_EditOpen()
return

The following VB sample unselects the text when the editor is opened ( in case the editor is an edit control ) ( by default, the control selects the text when editor is opened ). The following VB sample unselects the text when the editor is opened, by sending an EM_SETSEL message to the cell's edit control:

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const EM_SETSEL = &HB1

Private Sub Grid1_EditOpen()
    PostMessage Grid1.Editing, EM_SETSEL, 0, 0
End Sub

The following C++ sample unselects the text, when the editor is opened ( in case the editor is an edit control ):

void OnEditOpenGrid1() 
{
	::PostMessage( (HWND)m_grid.GetEditing(), EM_SETSEL, 0, 0 );
}
The following VB sample determines the handle of the edit control, without using the Editing property. 

The VB sample requires the following declarations:

 

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.