0
我有一個datagridview 3列中,我想datagridview 無焦點第一列,PLZ任何人可以幫助我plzzz我怎麼能做到這一點。如何將DataGridview的一列用於Tabstop propertie = false C#.net win apps?
我有一個datagridview 3列中,我想datagridview 無焦點第一列,PLZ任何人可以幫助我plzzz我怎麼能做到這一點。如何將DataGridview的一列用於Tabstop propertie = false C#.net win apps?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace DataGridViewValidation.Controls
{
public class DataGridViewTabColumnFalse : DataGridView
{
protected override bool ProcessDataGridViewKey(KeyEventArgs e)
{
if (e.KeyCode == Keys.Tab)
{
if (CurrentCell.ColumnIndex == 0)
{
e.SuppressKeyPress = true;
return true;
}
}
return base.ProcessDataGridViewKey(e);
}
protected override bool ProcessDialogKey(Keys keyData)
{
if (keyData == Keys.Tab)
{
if (CurrentCell.ColumnIndex == 0)
{
return true;
}
}
return base.ProcessDialogKey(keyData);
}
}
}