オートコンプリートの項目を矢印キーで選択することはできますか?

文書番号 : 38970     文書種別 : 使用方法     登録日 : 2015/07/02     最終更新日 : 2015/07/02
文書を印刷する
対象製品
SPREAD for Windows Forms 8.0J
詳細
上下矢印キーは、デフォルトでセルの移動に割り当てられています。オートコンプリートの項目を上下矢印キーで選択できるようにするには、編集コントロールによる矢印キーの処理方法を変更する必要があります。

◎サンプルコード(VB)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  ' テキスト型セルの作成
  Dim text As New FarPoint.Win.Spread.CellType.TextCellType()
  text.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrowsIgnoringMultiline
  text.AutoCompleteMode = AutoCompleteMode.SuggestAppend
  text.AutoCompleteSource = AutoCompleteSource.CustomSource
  text.AutoCompleteCustomSource.Add("a100")
  text.AutoCompleteCustomSource.Add("a200")
  text.AutoCompleteCustomSource.Add("a300")
  ' SPREADの設定
  FpSpread1.ActiveSheet.Columns(0).CellType = text
End Sub


◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
  // テキスト型セルの作成
  FarPoint.Win.Spread.CellType.TextCellType text = new FarPoint.Win.Spread.CellType.TextCellType();
  text.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrowsIgnoringMultiline;
  text.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
  text.AutoCompleteSource = AutoCompleteSource.CustomSource;
  text.AutoCompleteCustomSource.Add("a100");
  text.AutoCompleteCustomSource.Add("a200");
  text.AutoCompleteCustomSource.Add("a300");
  // SPREADの設定
  fpSpread1.ActiveSheet.Columns[0].CellType = text;
}