作成日: 2018/09/18 最終更新日: 2018/09/18
文書種別
不具合
状況
修正済み
詳細
この現象は、フォームにSPREADとInputManのGcShortcutコントロールを配置した場合に発生します。GcShortcutコントロールで割り当てたショートカットキーが、アプリケーションを実行してしばらくすると機能しなくなることがあります。
※ガベージコレクション発生後に機能しなくなります。
【実行手順】
1. TextBoxを2つ、Button、InputManのGcShortcutコントロール、SPREADを配置します
2. 以下のサンプルコードをコピーして実行します
3. [Enter]キーを押します
- TextBoxのフォーカスが次のコントロールに移動します
4. Buttonをクリックしてガベージコレクションを実行します
5. 3.の手順を繰り返します
- TextBoxからフォーカスが移動しません
【サンプルコード】
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TextBoxにショートカットキーを割り当てる
GcShortcut1.GetShortcuts(TextBox1).Add(Keys.Enter, GcShortcut1, "NextControl")
GcShortcut1.GetShortcuts(TextBox2).Add(Keys.Enter, GcShortcut1, "NextControl")
'SPREADにInputManセルを設定(この例ではGcTextBox型セル)
FpSpread1.ActiveSheet.Cells(0, 0).CellType = New GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'ガベージコレクションを実行
GC.Collect()
TextBox1.Focus()
End Sub
※ガベージコレクション発生後に機能しなくなります。
【実行手順】
1. TextBoxを2つ、Button、InputManのGcShortcutコントロール、SPREADを配置します
2. 以下のサンプルコードをコピーして実行します
3. [Enter]キーを押します
- TextBoxのフォーカスが次のコントロールに移動します
4. Buttonをクリックしてガベージコレクションを実行します
5. 3.の手順を繰り返します
- TextBoxからフォーカスが移動しません
【サンプルコード】
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TextBoxにショートカットキーを割り当てる
GcShortcut1.GetShortcuts(TextBox1).Add(Keys.Enter, GcShortcut1, "NextControl")
GcShortcut1.GetShortcuts(TextBox2).Add(Keys.Enter, GcShortcut1, "NextControl")
'SPREADにInputManセルを設定(この例ではGcTextBox型セル)
FpSpread1.ActiveSheet.Cells(0, 0).CellType = New GrapeCity.Win.Spread.InputMan.CellType.GcTextBoxCellType
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'ガベージコレクションを実行
GC.Collect()
TextBox1.Focus()
End Sub
回避方法
SPREAD for Windows Forms 10.0JのService Pack 2(v10.0.4006.2012)で修正済み。
旧文書番号
83236