private void Search_KeyDown(object sender, KeyEventArgs e)
{
if (Tree.TexCount != 0)
{
if (e.KeyCode == Keys.Enter)
{
Task.Run(() =>
{
if (SearchBox.Text != "")
{
UsefulThings.WinForms.Transitions.Transition.run(TabSearchSplitter, "SplitterDistance", TabSearchSplitter.Height / 2, new UsefulThings.WinForms.Transitions.TransitionType_CriticalDamping(400));
int start = Environment.TickCount;
Search.SearchAllv5(SearchBox.Text, SearchListBox, "new");
TimeSpan ts = TimeSpan.FromTicks(Environment.TickCount - start);
Console.WriteLine();
}
});
e.Handled = true;
e.SuppressKeyPress = true;
}
else if (e.Control && e.KeyCode == Keys.Back)
{
if (SearchBox.Text != "")
{
string text = SearchBox.Text;
int length = text.LastIndexOfAny(new char[] { '_', ' ', '-', '\\' });
SearchBox.Text = text.Substring(0, length + 1);
SearchBox.SelectionStart = SearchBox.Text.Length;
SearchBox.SelectionLength = 0;
}
e.Handled = true;
e.SuppressKeyPress = true;
}
}
}