MESCIUS SPREAD for Windows Forms 15.0J
Value プロパティ (DropDownClosingEventArgs)
使用例 

ドロップダウンに設定された値を取得または設定します。
構文
'宣言
 
Public Property Value As Object
public object Value {get; set;}

プロパティ値

ドロップダウンダイアログからの値を示すobject
解説
このプロパティは、ドロップダウンダイアログの値を取得します。
使用例
次のサンプルコードは、Valueプロパティを使用します。
fpSpread1.ActiveSheet.Cells[0, 0].CellType = new GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType();
          
        private void fpSpread1_EditModeOn(object sender, EventArgs e)
        {
            if (fpSpread1.EditingControl is GrapeCity.Win.Spread.InputMan.CellType.GcDateTime)
                ((GrapeCity.Win.Spread.InputMan.CellType.GcDateTime)fpSpread1.EditingControl).DropDownClosing += new EventHandler<GrapeCity.Win.Spread.InputMan.CellType.DropDownClosingEventArgs>(IMCellType_DropDownClosing);

        }

        private void fpSpread1_EditModeOff(object sender, EventArgs e)
        {
            if (fpSpread1.EditingControl is GrapeCity.Win.Spread.InputMan.CellType.GcDateTime)
                ((GrapeCity.Win.Spread.InputMan.CellType.GcDateTime)fpSpread1.EditingControl).DropDownClosing -= new EventHandler<GrapeCity.Win.Spread.InputMan.CellType.DropDownClosingEventArgs>(IMCellType_DropDownClosing);
        }

        void IMCellType_DropDownClosing(object sender, GrapeCity.Win.Spread.InputMan.CellType.DropDownClosingEventArgs e)
        {
            if (e.Value != null)
            {
                listBox1.Items.Add(e.Value.ToString());
            }
fpSpread1.ActiveSheet.Cells(0, 0).CellType = New GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType
 
    Private Sub fpSpread1_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles fpSpread1.EditModeOff
        If TypeOf (fpSpread1.EditingControl) Is GrapeCity.Win.Spread.InputMan.CellType.GcDateTime Then
            RemoveHandler CType(fpSpread1.EditingControl, GrapeCity.Win.Spread.InputMan.CellType.GcDateTime).DropDownClosing, AddressOf IMCellType_DropDownClosing
        End If
    End Sub

    Private Sub fpSpread1_EditModeOn(ByVal sender As Object, ByVal e As System.EventArgs) Handles fpSpread1.EditModeOn
        If TypeOf (fpSpread1.EditingControl) Is GrapeCity.Win.Spread.InputMan.CellType.GcDateTime Then
            AddHandler CType(fpSpread1.EditingControl, GrapeCity.Win.Spread.InputMan.CellType.GcDateTime).DropDownClosing, AddressOf IMCellType_DropDownClosing
        End If
    End Sub

    Private Sub IMCellType_DropDownClosing(ByVal sender As Object, ByVal e As GrapeCity.Win.Spread.InputMan.CellType.DropDownClosingEventArgs)
        If e.Value <> Nothing Then
            ListBox1.Items.Add(e.Value.ToString())
        End If
参照

DropDownClosingEventArgs クラス
DropDownClosingEventArgs メンバ

 

 


© MESCIUS inc. All rights reserved.