IDataGridViewEditingControl.EditingPanelCursor 属性

定义

获取当鼠标指针位于 EditingPanel 上方但不位于编辑控件上方时所使用的光标。Gets the cursor used when the mouse pointer is over the EditingPanel but not over the editing control.

public:
 property System::Windows::Forms::Cursor ^ EditingPanelCursor { System::Windows::Forms::Cursor ^ get(); };
public System.Windows.Forms.Cursor EditingPanelCursor { get; }
member this.EditingPanelCursor : System.Windows.Forms.Cursor
Public ReadOnly Property EditingPanelCursor As Cursor

属性值

一个 Cursor,表示用于编辑面板的鼠标指针。A Cursor that represents the mouse pointer used for the editing panel.

示例

下面的代码示例提供了此成员的实现。The following code example provides an implementation of this member. 此示例摘自了如何:Windows 窗体 DataGridView 单元中的主机控件。This example is part of a larger example available in How to: Host Controls in Windows Forms DataGridView Cells.

// Implements the IDataGridViewEditingControl
// .EditingPanelCursor property.
public Cursor EditingPanelCursor
{
    get
    {
        return base.Cursor;
    }
}
Public ReadOnly Property EditingControlCursor() As Cursor _
    Implements IDataGridViewEditingControl.EditingPanelCursor

    Get
        Return MyBase.Cursor
    End Get

End Property

注解

编辑面板是PanelDataGridView控件处于编辑模式时承载编辑控件的。The editing panel is the Panel that hosts the editing control when the DataGridView control is in edit mode. 实际编辑控件可能不会涵盖编辑面板的整个区域。The actual editing control may not cover the entire area of the editing panel. 在这种情况下EditingPanelCursor , 实现应返回当鼠标指针位于面板上但不悬停于控件上时要使用的光标。In this case, the EditingPanelCursor implementation should return the cursor to use when the mouse pointer is over the panel but not over the control. 通常, 您需要返回控件使用的相同游标。Typically, you will want to return the same cursor that the control uses. 如果要更改指针位于控件上时显示的光标, 则必须设置Cursor属性。If you want to change the cursor that appears when the pointer is over the control, you must set the Cursor property. 可以在IDataGridViewEditingControl实现的构造函数中设置此项, 也可以PrepareEditingControlForEdit在实现中设置此项。You can set this in the constructor of the IDataGridViewEditingControl implementation, or you can set it in the PrepareEditingControlForEdit implementation.

适用于

另请参阅