/// <summary> /// userpass焦点 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void textBox1_GotFocus(object sender, RoutedEventArgs e) { NumKeyBoard nkb = new NumKeyBoard(); nkb.tb = textBox1; keyFram.Content = nkb; }
/// <summary> /// 加载附加资源 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MetroWindow_Loaded(object sender, RoutedEventArgs e) { unName.Text = ConfigurationManager.AppSettings["unName"]; unEName.Text = ConfigurationManager.AppSettings["unEName"]; dtimer = new System.Windows.Threading.DispatcherTimer(); //每100秒刷新一次 dtimer.Interval = TimeSpan.FromSeconds(100); dtimer.Tick += dtimer_Tick; dtimer.Start(); //string str1 = BLL.HttpBLL.GetResponseString(BLL.HttpBLL.CreatePostHttpResponse("", null)); adtimer = new System.Windows.Threading.DispatcherTimer(); adtimer.Interval = TimeSpan.FromSeconds(1); adtimer.Tick += adtimer_Tick; adtimer.Start(); stadtimer = new System.Windows.Threading.DispatcherTimer(); stadtimer.Interval = TimeSpan.FromSeconds(3); stadtimer.Tick += stadtimer_Tick; stadtimer.Start(); this.KeyDown += ModifyPrice_KeyDown; fram.Content = null; NumKeyBoard nkb = new NumKeyBoard(); nkb.tb = textBox; fram.Content = nkb; }
/// <summary> /// text 获取焦点处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void textBox_GotFocus(object sender, RoutedEventArgs e) { textBox.Text = null; fram.Content = null; NumKeyBoard nkb = new NumKeyBoard(); nkb.tb = textBox; fram.Content = nkb; }