public MainWindow() { InitializeComponent(); //主窗口设置 double winWidth = SystemParameters.WorkArea.Width; double winHeight = SystemParameters.WorkArea.Height; if (1280 < winWidth) { Width = 1280; } else { Width = winWidth; } if (800 < winHeight) { Height = 800; } else { Height = winHeight; } //初始化智能下拉列表功能 SmartList.Initialization(66, 100, 200, Global.SmartPath); }
/// <summary> /// 文本框获得逻辑焦点-> /// comNameTB专用 /// </summary> protected void comNameTB_GotFocus(object sender, RoutedEventArgs e) { SmartList.TBGotFocus(sender as TextBox, SmartLB, BodyGrid, true, CompanyNameList); }
/// <summary> /// 文本框内容改变-> /// 筛选SmartInfo列表显示到SmartLB /// </summary> protected void SmartTB_TextChanged(object sender, TextChangedEventArgs e) { SmartList.TBChanged(SmartLB); }
/// <summary> /// 文本框有键盘键按下-> /// 上下键,逻辑焦点给SmartLB /// </summary> protected void SmartTB_PreviewKeyDown(object sender, KeyEventArgs e) { SmartList.TBKeyDown(SmartLB, e); }
/// <summary> /// 文本框丢失逻辑焦点-> /// 不更新(适用于用户给定SmartInfo列表) /// </summary> protected void SmartTB_LostFocusNotUpdate(object sender, RoutedEventArgs e) { SmartList.TBLostFocus(SmartLB, false); }
/// <summary> /// 文本框丢失逻辑焦点-> /// 更新文本框Tag对应标记(Mark)的权重及时间 /// </summary> protected void SmartTB_LostFocus(object sender, RoutedEventArgs e) { SmartList.TBLostFocus(SmartLB, true); }
/// <summary> /// 文本框获得逻辑焦点-> /// 生成文本框Tag对应标记(Mark)的SmartInfo列表 /// </summary> protected void SmartTB_GotFocus(object sender, RoutedEventArgs e) { SmartList.TBGotFocus(sender as TextBox, SmartLB, BodyGrid, true); }
private void SmartLB_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) { SmartList.FillText(SmartLB); }
private void SmartLB_PreviewKeyDown(object sender, KeyEventArgs e) { SmartList.LBKeyDown(SmartLB, e); }
private void NavigationWindow_Closed(object sender, System.EventArgs e) { //保存智能下拉列表功能 SmartList.Save(); //保存智能下拉列表功能 }