DataGridTextBox.IsInEditOrNavigateMode 属性
获取或设置一个值,该值指示 DataGridTextBox 是否处于允许编辑或浏览的模式中。
**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)
语法
声明
Public Property IsInEditOrNavigateMode As Boolean
用法
Dim instance As DataGridTextBox
Dim value As Boolean
value = instance.IsInEditOrNavigateMode
instance.IsInEditOrNavigateMode = value
public bool IsInEditOrNavigateMode { get; set; }
public:
property bool IsInEditOrNavigateMode {
bool get ();
void set (bool value);
}
/** @property */
public boolean get_IsInEditOrNavigateMode ()
/** @property */
public void set_IsInEditOrNavigateMode (boolean value)
public function get IsInEditOrNavigateMode () : boolean
public function set IsInEditOrNavigateMode (value : boolean)
属性值
如果控件处于导航模式,而且编辑还没有开始,则为 true;否则为 false。默认为 true。
备注
IsInEditOrNavigateMode 属性用在 ProcessKeyMessage 中来确定如何处理按键事件和检查 DataGridTextBox 的状态。例如,如果按下导航(箭头)键之一,则对应于该控件状态的操作必须发生。
示例
' 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 'Button_ClickEvent
// 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 void Button_ClickEvent(Object sender, EventArgs e)
{
if (myDataGridTextBox.get_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");
}
} //Button_ClickEvent
平台
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
DataGridTextBox 类
DataGridTextBox 成员
System.Windows.Forms 命名空间