DataGridTextBox.IsInEditOrNavigateMode 属性

定义

获取或设置一个值,该值指示 DataGridTextBox 是否处于允许编辑或浏览的模式中。Gets or sets a value indicating whether the DataGridTextBox is in a mode that allows either editing or navigating.

public:
 property bool IsInEditOrNavigateMode { bool get(); void set(bool value); };
public bool IsInEditOrNavigateMode { get; set; }
member this.IsInEditOrNavigateMode : bool with get, set
Public Property IsInEditOrNavigateMode As Boolean

属性值

Boolean

如果控件处于导航模式,而且编辑还没有开始,则为 true;否则为 falsetrue if the controls is in navigation mode, and editing has not begun; otherwise, false. 默认值为 trueThe default is true.

示例

下面的代码示例演示如何使用此成员。The following code example demonstrates the use of this member.

   // Handle event to show the state of 'IsInEditOrNavigateMode'.
private:
   void Button_ClickEvent( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      if ( myDataGridTextBox->IsInEditOrNavigateMode )
      {
         // DataGridTextBox has not been edited.
         MessageBox::Show( "Editing of DataGridTextBox not begun, IsInEditOrNavigateMode = True" );
      }
      else
      {         
         // DataGridTextBox has been edited.
         MessageBox::Show( "Editing of DataGridTextBox begun, IsInEditOrNavigateMode = False" );
      }
   }
// Handle event to show the state of 'IsInEditOrNavigateMode'.
private void Button_ClickEvent(object sender, EventArgs e)
{

   if (myDataGridTextBox.IsInEditOrNavigateMode)
   {
      // DataGridTextBox has not been edited.
      MessageBox.Show("Editing of DataGridTextBox not begun, IsInEditOrNavigateMode = True");
   }
   else
   {
      // DataGridTextBox has been edited.
      MessageBox.Show("Editing of DataGridTextBox begun, IsInEditOrNavigateMode = False");
   }
}
' Handle event to show the state of 'IsInEditOrNavigateMode'.
Private Sub Button_ClickEvent(sender As Object, e As EventArgs)
   
   If myDataGridTextBox.IsInEditOrNavigateMode Then
      ' DataGridTextBox has not been edited.
      MessageBox.Show("Editing of DataGridTextBox not begun,IsInEditOrNavigateMode = True")
   Else
      ' DataGridTextBox has been edited.
      MessageBox.Show("Editing of DataGridTextBox begun,IsInEditOrNavigateMode = False")
   End If
End Sub

注解

IsInEditOrNavigateMode 中使用属性 ProcessKeyMessage 来确定如何处理按键事件,以检查的状态 DataGridTextBoxThe IsInEditOrNavigateMode property is used within the ProcessKeyMessage to determine how to process key press events, to check the state of the DataGridTextBox. 例如,如果按下某个导航 (箭头) 键,则必须对控件的状态进行适当的操作。For example, if one of the navigation (arrow) keys is pressed, the appropriate action for the state of the control must occur.

适用于