Browse Subversion Repository
Contents of /SchoolIdolFestivalSimulator.Main/EnterGrid.cs
Parent Directory
| Revision Log
Revision 47 -
( show annotations)
( download)
Tue Jul 15 15:15:24 2014 UTC
(9 years, 9 months ago)
by kayochin_3141
File size: 1285 byte(s)
3.2.0.1
部員入力FormをGridに変更
| 1 |
using System; |
| 2 |
using System.Collections.Generic; |
| 3 |
using System.Linq; |
| 4 |
using System.Text; |
| 5 |
using System.Windows.Forms; |
| 6 |
namespace SchoolIdolFestivalSimulator.Main { |
| 7 |
|
| 8 |
public class EnterGrid : DataGridView { |
| 9 |
public EnterGrid() { |
| 10 |
this.DoubleBuffered = true; |
| 11 |
} |
| 12 |
protected override bool ProcessDialogKey(Keys keyData) { |
| 13 |
//Enterキーが押された時は、Tabキーが押されたようにする |
| 14 |
if ((keyData & Keys.KeyCode) == Keys.Enter) { |
| 15 |
return this.ProcessTabKey(keyData); |
| 16 |
} |
| 17 |
return base.ProcessDialogKey(keyData); |
| 18 |
} |
| 19 |
protected override bool ProcessDataGridViewKey(KeyEventArgs e){ |
| 20 |
if(e.KeyCode == Keys.Enter){ |
| 21 |
return this.ProcessRightKey(e.KeyData); |
| 22 |
} |
| 23 |
return base.ProcessDataGridViewKey(e); |
| 24 |
} |
| 25 |
|
| 26 |
protected bool ProcessRightKey(KeyEventArgs e) { |
| 27 |
if(base.CurrentCell.ColumnIndex == base.ColumnCount - 1 && base.CurrentCell.RowIndex + 1 <= base.RowCount - 1){ |
| 28 |
base.CurrentCell = base.Rows[(base.CurrentCell.RowIndex + 1)].Cells[0]; |
| 29 |
return true; |
| 30 |
} |
| 31 |
return base.ProcessDataGridViewKey(e); |
| 32 |
} |
| 33 |
} |
| 34 |
} |
|