PowerTools SPREAD for Windows Forms 8.0J
FilterBarContextMenuType 列挙体


IFilterItemでサポートされているコンテキストメニューのタイプを設定します。
構文
'Declaration
 
Public Enum FilterBarContextMenuType 
   Inherits System.Enum
'使用法
 
Dim instance As FilterBarContextMenuType
public enum FilterBarContextMenuType : System.Enum 
メンバ
メンバ説明
Colorアイコンと色のコンテキストメニューを指定します。
DateTime日付時刻コンテキストメニューを指定します。
Number値コンテキストメニューを指定します。
Textテキストコンテキストメニューを指定します。
次のサンプルコードは、FilterBarContextMenuType列挙体を使用します。
FarPoint.Win.Spread.CellType.FilterBarCellType ct = new FarPoint.Win.Spread.CellType.FilterBarCellType();
ct.ShowDropDownMenuStrip = true;
ct.ShowEditor = true;
ct.ShowLabel = true;
ct.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.DateTime;
System.Globalization.DateTimeFormatInfo dtformat = new System.Globalization.DateTimeFormatInfo();
dtformat.ShortDatePattern = "yy/MM/dd";
dtformat.ShortTimePattern = "";
dtformat.LongTimePattern = "";
ct.DateTimeFormatInfo = dtformat;
ct.AutoFormat = true;
FarPoint.Win.Spread.CellType.FilterBarCellType ct1 = new FarPoint.Win.Spread.CellType.FilterBarCellType();
ct1.ShowEditor = true;
ct1.ShowLabel = true;
ct1.FormatString = "dd";
ct1.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.DateTime;
ct1.AutoFormat = true;

FarPoint.Win.Spread.CellType.FilterBarCellType ct2 = new FarPoint.Win.Spread.CellType.FilterBarCellType();
ct2.ShowEditor = true;
ct2.ShowLabel = true;
System.Globalization.NumberFormatInfo num = new System.Globalization.NumberFormatInfo();
num.CurrencySymbol = "$";
num.CurrencyDecimalDigits = 3;
ct2.NumberFormatInfo = num;
ct2.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.Number;
ct2.AutoFormat = true;
        
fpSpread1.ActiveSheet.FilterBar.Cells[0].CellType = ct;
fpSpread1.ActiveSheet.FilterBar.Cells[0].BackColor = Color.Red;
fpSpread1.ActiveSheet.FilterBar.Cells[1].CellType = ct1;
fpSpread1.ActiveSheet.FilterBar.Cells[1].BackColor = Color.Aqua;
fpSpread1.ActiveSheet.FilterBar.Cells[2].CellType = ct2;
fpSpread1.ActiveSheet.FilterBar.Cells[2].BackColor = Color.Yellow;
fpSpread1.ActiveSheet.ColumnHeader.Columns[0].Label = "DateTime";
fpSpread1.ActiveSheet.ColumnHeader.Columns[1].Label = "FormatString";
fpSpread1.ActiveSheet.ColumnHeader.Columns[2].Label = "Number";
fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.FilterBar;
fpSpread1.ActiveSheet.Cells[0, 1].CellType = new FarPoint.Win.Spread.CellType.DateTimeCellType();
Dim ct As New FarPoint.Win.Spread.CellType.FilterBarCellType()
ct.ShowDropDownMenuStrip = True
ct.ShowEditor = True
ct.ShowLabel = True
ct.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.DateTime
Dim dtformat As New System.Globalization.DateTimeFormatInfo()
dtformat.ShortDatePattern = "yy/MM/dd"
dtformat.ShortTimePattern = ""
dtformat.LongTimePattern = ""
ct.DateTimeFormatInfo = dtformat
ct.AutoFormat = True
Dim ct1 As New FarPoint.Win.Spread.CellType.FilterBarCellType()
ct1.ShowEditor = True
ct1.ShowLabel = True
ct1.FormatString = "dd"
ct1.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.DateTime
ct1.AutoFormat = True

Dim ct2 As New FarPoint.Win.Spread.CellType.FilterBarCellType()
ct2.ShowEditor = True
ct2.ShowLabel = True
Dim num As New System.Globalization.NumberFormatInfo()
num.CurrencySymbol = "$"
num.CurrencyDecimalDigits = 3
ct2.NumberFormatInfo = num
ct2.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.Number
ct2.AutoFormat = True
  
FpSpread1.ActiveSheet.FilterBar.Cells(0).CellType = ct
FpSpread1.ActiveSheet.FilterBar.Cells(0).BackColor = Color.Red
FpSpread1.ActiveSheet.FilterBar.Cells(1).CellType = ct1
FpSpread1.ActiveSheet.FilterBar.Cells(1).BackColor = Color.Aqua
FpSpread1.ActiveSheet.FilterBar.Cells(2).CellType = ct2
FpSpread1.ActiveSheet.FilterBar.Cells(2).BackColor = Color.Yellow
FpSpread1.ActiveSheet.ColumnHeader.Columns(0).Label = "DateTime"
FpSpread1.ActiveSheet.ColumnHeader.Columns(1).Label = "FormatString"
FpSpread1.ActiveSheet.ColumnHeader.Columns(2).Label = "Number"
FpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.FilterBar
FpSpread1.ActiveSheet.Cells(0, 1).CellType = New FarPoint.Win.Spread.CellType.DateTimeCellType()
継承階層

System.Object
   System.ValueType
      System.Enum
         FarPoint.Win.Spread.CellType.FilterBarContextMenuType

参照

FarPoint.Win.Spread.CellType 名前空間

 

 


© 2004-2015, GrapeCity inc. All rights reserved.