編集可能なコンボボックス型セルでの二重入力

文書番号 : 31470     文書種別 : 不具合     最終更新日 : 2014/11/27
文書を印刷する
対象製品
SPREAD 7.0J
発生環境
Windows Vista、7環境で発生します
状況
修正済み
詳細
編集可能なコンボボックス型セルにて、リストアイテム数が6の場合、値が二重入力されます。

【再現コード】
Private Const cbList1 As String = "1" & vbTab & "2" & vbTab & "3" & vbTab & "4" & vbTab & "5" & vbTab & "6"

Private Sub Form_Load()
  With fpSpread1
    .Col = 1
    .Row = 1
    .CellType = CellTypeComboBox
    .TypeComboBoxList = cbList1
    .TypeComboBoxEditable = True
  End With
End Sub

【再現手順】
1.プロジェクトを起動します。
2.編集可能なコンボボックス型セルであるA1に”1”を入力します。
 -- “11”と二重入力されます。
回避方法
最新の修正版 Ver7.0.0.60(2014/11/27版)をご使用ください。
それ以前のバージョンでは、次の回避策が有効です。

以下のいずれかの方法によって回避します。

1.常時入力モードを使用します。


2.下記のように該当セルに移動したら、セルを編集状態にします。

Private Sub fpSpread1_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)
  If NewCol = 1 Then
    fpSpread1.EditMode = True
  End If
End Sub


3. 編集時と非編集時でコンボボックスのリストを切り替えます(ダミー項目の使用)

Private Const cbList1 As String = "1" & vbTab & "2" & vbTab & "3" & vbTab & "4" & vbTab & "5" & vbTab & "6" & vbTab & " "
Private Const cbList2 As String = "1" & vbTab & "2" & vbTab & "3" & vbTab & "4" & vbTab & "5" & vbTab & "6"

Private Sub Form_Load()
  With fpSpread1
    .Col = 1
    .Row = 1
    .CellType = CellTypeComboBox
    .TypeComboBoxList = cbList1
    .TypeComboBoxEditable = True
  End With
End Sub

Private Sub fpSpread1_EditMode(ByVal Col As Long, ByVal Row As Long, ByVal Mode As Integer, ByVal ChangeMade As Boolean)
  If Col = 1 And Row = 1 Then
    fpSpread1.Col = 1
    fpSpread1.Row = 1
    
    If Mode = 1 Then
      fpSpread1.TypeComboBoxList = cbList2
    Else
      fpSpread1.TypeComboBoxList = cbList1
    End If
  End If
End Sub