private void TB_Search_KeyUp(object sender, KeyEventArgs e) { string search = string.Empty; if (TB_Search.InvokeRequired) { TB_Search.BeginInvoke(new Action(() => { search = TB_Search.Text; })); } else { search = TB_Search.Text; } if (!string.IsNullOrWhiteSpace(search)) { LB_SP.Items.Clear(); if (this.data != null && this.data.Count > 0) { foreach (var table in this.data) { if (table.name.IndexOf(search) > -1) { LB_SP.Items.Add(table.name); } } } } else { LB_SP.Items.Clear(); foreach (var table in this.data) { LB_SP.Items.Add(table.name); } } }
public FriendSelectWindow(Action <List <string>, List <string> > listener, bool isFriendList) { InitializeComponent(); this.listener = listener; instance = this; if (Properties.Settings.Default.HideScrollBar) { SV_Content.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; } if (isFriendList) { Title = "친구 목록"; RD_Submit.Height = new GridLength(0); RD_WithFriends.Height = new GridLength(0); } this.isFriendList = isFriendList; Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ContextIdle, new Action(() => TB_Search.Focus())); }
private void Window_Loaded(object sender, RoutedEventArgs e) { TB_Search.Focus(); }