作成日: 2018/10/29 最終更新日: 2019/02/07
文書種別
不具合
状況
修正済み
詳細
フィルタウィンドウを表示し、検索ボックスにカーソルを合わせた状態で、以下の操作を行うと、フィルタウィンドウが閉じられます。
- [Alt]キーを押下
- マウスの右クリック
回避方法
Service Pack 2(v2.0.2019.0207)で修正済みです。
Service Pack 2(v2.0.2019.0207)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
Altキーおよび右クリックを捕捉して、処理をキャンセルします。
◎サンプルコード(C#)
Service Pack 2(v2.0.2019.0207)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
Altキーおよび右クリックを捕捉して、処理をキャンセルします。
◎サンプルコード(C#)
public MainWindow()
{
InitializeComponent();
gcSpreadGrid1.RowCount = 26;
gcSpreadGrid1.ColumnCount = 1;
for (var i = 0; i < gcSpreadGrid1.RowCount; i++)
{
gcSpreadGrid1[i, 0].Value = new string((char)(65 + i), 1);
}
SkipKeys_SearchTextBox();
}
private void SkipKeys_SearchTextBox()
{
EventManager.RegisterClassHandler(typeof(SearchTextBox), SearchTextBox.PreviewKeyDownEvent, new KeyEventHandler(SearchBox_PreviewKeyDown));
EventManager.RegisterClassHandler(typeof(SearchTextBox), SearchTextBox.PreviewMouseRightButtonUpEvent, new MouseButtonEventHandler(SearchBox_PreviewMouseRightButtonUp));
}
private void SearchBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (AncestorOfType(sender as SearchTextBox) == null)
{
return;
}
if (e.Key == Key.System)
{
e.Handled = true;
}
}
private void SearchBox_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
if (AncestorOfType(sender as SearchTextBox) == null)
{
return;
}
e.Handled = true;
}
private static T AncestorOfType(DependencyObject element) where T : DependencyObject
{
if (element == null)
{
return null;
}
DependencyObject parent = element;
do
{
parent = VisualTreeHelper.GetParent(parent);
T candidate = parent as T;
if (candidate != null)
{
return candidate;
}
} while (parent != null);
return null;
}
旧文書番号
83338