既に入力してある値を、必ず上書きするには?
対象製品
El Tabelle for .NET 3.0J
詳細
El Tabelle では、既に値が入力されているセルに対し、再び値を入力すると値が追記されます。たとえば、「ABC」と入力されているセルに「DEF」を入力すると、セルの値は「ABCDEF」になります。
これに対し、Microsoft Excel では「ABC」と入力されているセルに「DEF」を入力すると、セルの値は「DEF」になります。
El Tabelle の動作を Microsoft Excel に合わせるには、ユーザーがセルの値を編集する直前にセルの値を消去します。
WorkBook/Sheet の場合、次のようにコーディングします。
[Visual Basic]
[C#]
MultiRowSheet の場合、次のようにコーディングします。
[Visual Basic]
[C#]
なお、各コントロールの HighlightEditText プロパティを true に設定することで実質的に同じ効果を得ることもできます。
これに対し、Microsoft Excel では「ABC」と入力されているセルに「DEF」を入力すると、セルの値は「DEF」になります。
El Tabelle の動作を Microsoft Excel に合わせるには、ユーザーがセルの値を編集する直前にセルの値を消去します。
WorkBook/Sheet の場合、次のようにコーディングします。
[Visual Basic]
Private Sub Sheet1_EnterEdit(ByVal sender As Object, _
ByVal e As GrapeCity.Win.ElTabelle.EnterEditEventArgs) _
Handles Sheet1.EnterEdit
Sheet1.ActiveCell.Value = ""
End Sub
ByVal e As GrapeCity.Win.ElTabelle.EnterEditEventArgs) _
Handles Sheet1.EnterEdit
Sheet1.ActiveCell.Value = ""
End Sub
[C#]
private void sheet1_EnterEdit(object sender,
GrapeCity.Win.ElTabelle.EnterEditEventArgs e)
{
sheet1.ActiveCell.Value = "";
}
GrapeCity.Win.ElTabelle.EnterEditEventArgs e)
{
sheet1.ActiveCell.Value = "";
}
MultiRowSheet の場合、次のようにコーディングします。
[Visual Basic]
Private Sub MultiRowSheet1_EnterEdit(ByVal sender As Object, _
ByVal e As GrapeCity.Win.ElTabelle.MEnterEditEventArgs) _
Handles MultiRowSheet1.EnterEdit
MultiRowSheet1.ActiveCell.Value = ""
End Sub
ByVal e As GrapeCity.Win.ElTabelle.MEnterEditEventArgs) _
Handles MultiRowSheet1.EnterEdit
MultiRowSheet1.ActiveCell.Value = ""
End Sub
[C#]
private void multiRowSheet1_EnterEdit(object sender,
GrapeCity.Win.ElTabelle.MEnterEditEventArgs e)
{
multiRowSheet1.ActiveCell.Value = "";
}
GrapeCity.Win.ElTabelle.MEnterEditEventArgs e)
{
multiRowSheet1.ActiveCell.Value = "";
}
なお、各コントロールの HighlightEditText プロパティを true に設定することで実質的に同じ効果を得ることもできます。
キーワード
HowTo
この文書は、以前は次のFAQ IDで公開されていました : 6751