CTCreateEditorControl Event
Applies To
fpSpread control
Description
Occurs when a custom cell type should create the editor control.
Syntax
afx_msg void OnCTCreateEditorControlfpSpread(LPCTSTRName, long Style, long CtrlId, VARIANT FAR*EditorControl);
Sub fpSpread_CTCreateEditorControl(ByVal Name As String, ByVal Style As Long, ByVal CtrlId As Long,EditorControl As Variant)
Parameters
The following parameters are available:
Parameter | Description |
---|---|
Name | Name of the custom cell type |
Style | Style for the cell |
CtrlId | Value to use for the control ID |
EditorControl | Editor control for editing the cell |
Remarks
Create an instance of the editing control to use for editing in this event.
The CtrlId specifies the control id to use when creating a window using CreateWindow to create the editor control as a child window of the Spread control. The id is passed into the hMenu parameter for CreateWindow or CreateWindowEx and it should have a unique value for each child window.
If you use CreateWindow or CreateWindowEx to create the window for the editor control (which is a child window of the Spread control), then you need to use the specified control id as the hMenu parameter to CreateWindow to avoid conflicts with the control ids of other custom cell controls. All built-in cell types that use controls create their controls in this manner.
If this event does not return an editor control, then the Spread control will attempt to create an instance using the custom cell type name as the class. The class should be previously registered with RegisterClass. If not, you will get a null.
Note: The EditorControl parameter can be set to a reference to an ActiveX control to use for editing the cell on your form, or it can be set with the window handle of a control window to use. If an ActiveX control is used, then it must have a window handle associated with it (windowless controls are not supported) and it must expose this handle through a property named "hWnd" or "Handle" so that Spread can get this handle. Use the ActiveX control instance for the EditorControl parameter rather than the hWnd since ActiveX controls may destroy and recreate their window handles and make this handle invalid.
This event does not fire for custom cell types that use False for the Editable parameter in the AddCustomCellType function.
See Also
SheetSendingEvent property
SS_CT_CREATEEDITORCONTRL_ARGS structure
CTCancelEditing events