作成日: 2016/03/30 最終更新日: 2016/05/18
文書種別
不具合
状況
修正済み
詳細
フローティング状態のドッキングタブ上でC1ComboBoxの項目を選択した後、ドッキングタブをドッキング状態に戻して、再度C1ComboBoxの項目を選択すると、以下のようなObjectDisposedExceptionの例外が発生します。
(例外)
型 'System.ObjectDisposedException' のハンドルされていない例外が System.Windows.Forms.dll で発生しました。
追加情報:破棄されたオブジェクトにアクセスできません。
(例外)
型 'System.ObjectDisposedException' のハンドルされていない例外が System.Windows.Forms.dll で発生しました。
追加情報:破棄されたオブジェクトにアクセスできません。
回避方法
この問題はバージョン2.0.20161.147または4.0.20161.147で修正されました。
修正版の適用方法については、アップデートの方法を参照してください。
修正版を適用しない場合の回避方法は次の通りです。
C1ComboBoxのBeforeDropDownイベントにて、ドロップダウンフォームのインスタンスが破棄されていた場合に直接C1ComboBoxItemsFormクラスのインスタンスを生成して渡します。
◎サンプルコード(VB)
◎サンプルコード(C#)
修正版の適用方法については、アップデートの方法を参照してください。
修正版を適用しない場合の回避方法は次の通りです。
C1ComboBoxのBeforeDropDownイベントにて、ドロップダウンフォームのインスタンスが破棄されていた場合に直接C1ComboBoxItemsFormクラスのインスタンスを生成して渡します。
◎サンプルコード(VB)
Imports System.Reflection
Private Sub C1ComboBox1_BeforeDropDownOpen(sender As Object, e As CancelEventArgs)
If C1ComboBox1.DropDownForm Is Nothing OrElse C1ComboBox1.DropDownForm.IsDisposed Then
Dim asm As Assembly = Assembly.GetAssembly(GetType(C1ComboBox))
Dim type As Type = asm.[GetType]("C1.Win.C1Input.C1ComboBoxItemsForm")
Dim form As DropDownForm = TryCast(type.GetConstructor(New () {GetType(C1ComboBox)}).Invoke(New () {C1ComboBox1}), DropDownForm)
C1ComboBox1.DropDownForm = form
End If
End Sub
◎サンプルコード(C#)
using System.Reflection;
private void c1ComboBox1_BeforeDropDownOpen(object sender, CancelEventArgs e)
{
if(c1ComboBox1.DropDownForm == null || c1ComboBox1.DropDownForm.IsDisposed)
{
Assembly asm = Assembly.GetAssembly(typeof(C1ComboBox));
Type type = asm.GetType("C1.Win.C1Input.C1ComboBoxItemsForm");
DropDownForm form = type.GetConstructor(new[] { typeof(C1ComboBox) }).Invoke(new[] { c1ComboBox1 }) as DropDownForm;
c1ComboBox1.DropDownForm = form;
}
}
旧文書番号
81603