private void TextBox_GotFocus(object sender, RoutedEventArgs e) { HandyControl.Controls.TextBox textBox = sender as HandyControl.Controls.TextBox; textBox.Background = (SolidColorBrush)Application.Current.Resources["ForegroundSearch"]; textBox.Foreground = (SolidColorBrush)Application.Current.Resources["BackgroundMenu"]; textBox.CaretBrush = (SolidColorBrush)Application.Current.Resources["BackgroundMenu"]; }
private void TextBox_LostFocus(object sender, RoutedEventArgs e) { HandyControl.Controls.TextBox textBox = sender as HandyControl.Controls.TextBox; textBox.Background = Brushes.Transparent; textBox.Foreground = (SolidColorBrush)Application.Current.Resources["ForegroundGlobal"]; if (textBox.Name == "url") { vieModel_Settings.Servers[CurrentRowIndex].Url = textBox.Text; } else { vieModel_Settings.Servers[CurrentRowIndex].Cookie = textBox.Text; } }
private void TestBtn_Click(object sender, RoutedEventArgs e) { IDict dict = new XxgJpzhDict(); dict.DictInit(Common.appSettings.xxgPath, ""); string ret = dict.SearchInDict(TestSrcText.Text); if (ret != null) { ret = XxgJpzhDict.RemoveHTML(ret); var textbox = new HandyControl.Controls.TextBox(); textbox.Text = ret; textbox.FontSize = 15; textbox.TextWrapping = TextWrapping.Wrap; textbox.TextAlignment = TextAlignment.Left; textbox.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible; var window = new HandyControl.Controls.PopupWindow { PopupElement = textbox, WindowStartupLocation = WindowStartupLocation.CenterScreen, BorderThickness = new Thickness(0, 0, 0, 0), MaxWidth = 600, MaxHeight = 300, MinWidth = 600, MinHeight = 300, Title = "字典结果" }; window.Show(); } else { HandyControl.Controls.Growl.Error("查询错误!" + dict.GetLastError()); } }