【テキスト型セル】 「複数行入力」「折り返し表示」「スクロールバー表示」などの機能を実装出来ますか?

文書番号 : 33574     文書種別 : 使用方法     登録日 : 2012/11/14     最終更新日 : 2012/11/14
文書を印刷する
対象製品
SPREAD for Windows Forms 7.0J
詳細
テキスト型セル(TextCellType)に属するメンバの設定により、以下のような機能を実現することが出来ます。詳細、および下記以外のメンバについては製品ヘルプをご参照ください。

◎複数行入力を可能とする(VB)
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FpSpread1.ActiveSheet.RowHeader.Rows(0).Height = 50
    Dim t As New FarPoint.Win.Spread.CellType.TextCellType
    t.Multiline = True
    FpSpread1.ActiveSheet.Cells(0, 0).CellType = t
  End Sub


◎同(C#)
  private void Form1_Load(object sender, System.EventArgs e)
  {
    fpSpread1.ActiveSheet.RowHeader.Rows[0].Height = 50;
    FarPoint.Win.Spread.CellType.TextCellType t = new FarPoint.Win.Spread.CellType.TextCellType();
    t.Multiline = true;
    fpSpread1.ActiveSheet.Cells[0,0].CellType = t;
  }


◎入力文字を常に大文字とする
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim t As New FarPoint.Win.Spread.CellType.TextCellType
    t.CharacterCasing = CharacterCasing.Upper
    FpSpread1.ActiveSheet.Cells(0, 0).CellType = t
  End Sub


◎同(C#)
  private void Form1_Load(object sender, System.EventArgs e)
  {
    FarPoint.Win.Spread.CellType.TextCellType t = new FarPoint.Win.Spread.CellType.TextCellType();
    t.CharacterCasing = CharacterCasing.Upper;
    fpSpread1.ActiveSheet.Cells[0,0].CellType = t;
  }


◎入力文字数の制限
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim t As New FarPoint.Win.Spread.CellType.TextCellType
    t.MaxLength = 10
    FpSpread1.ActiveSheet.Cells(0, 0).CellType = t
  End Sub


◎同(C#)
  private void Form1_Load(object sender, System.EventArgs e)
  {
    FarPoint.Win.Spread.CellType.TextCellType t = new FarPoint.Win.Spread.CellType.TextCellType();
    t.MaxLength= 10;
    fpSpread1.ActiveSheet.Cells[0,0].CellType = t;
  }


◎折り返し表示を行う
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FpSpread1.ActiveSheet.RowHeader.Rows(0).Height = 50
    Dim t As New FarPoint.Win.Spread.CellType.TextCellType
    t.WordWrap = True
    FpSpread1.ActiveSheet.Cells(0, 0).CellType = t
  End Sub


◎同(C#)
  private void Form1_Load(object sender, System.EventArgs e)
  {
    fpSpread1.ActiveSheet.RowHeader.Rows[0].Height = 50;
    FarPoint.Win.Spread.CellType.TextCellType t = new FarPoint.Win.Spread.CellType.TextCellType();
    t.WordWrap= true;
    fpSpread1.ActiveSheet.Cells[0,0].CellType = t;
  }


◎スクロールバー表示を行う ※編集モード時のみ表示されます
  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FpSpread1.ActiveSheet.RowHeader.Rows(0).Height = 50
    Dim t As New FarPoint.Win.Spread.CellType.TextCellType
    t.Multiline = True
    t.ScrollBars = ScrollBars.Vertical
    FpSpread1.ActiveSheet.Cells(0, 0).CellType = t
  End Sub


◎同(C#)
  private void Form1_Load(object sender, System.EventArgs e)
  {
    fpSpread1.ActiveSheet.RowHeader.Rows[0].Height = 50;
    FarPoint.Win.Spread.CellType.TextCellType t = new FarPoint.Win.Spread.CellType.TextCellType();
    t.Multiline = true;
    t.ScrollBars = ScrollBars.Vertical;
    fpSpread1.ActiveSheet.Cells[0,0].CellType = t;
  }
関連情報
キーワード
「テキスト型セル」