private string DisplayKeyboard(string KeyText, string type) { try { this.Cursor = Cursors.Wait; strKeyText = ""; KeyboardInterface objKeyboard = new KeyboardInterface(); if (type == "Pwd") { objKeyboard.IsPwd = true; } objKeyboard.Closing += new System.ComponentModel.CancelEventHandler(objKeyboard_Closing); objKeyboard.KeyString = KeyText; Point locationFromScreen = CFactoryReset.FactoryResetInstance.PointToScreen(new Point(0, 0)); PresentationSource source = PresentationSource.FromVisual(this); System.Windows.Point targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); objKeyboard.Top = targetPoints.Y + CFactoryReset.FactoryResetInstance.Height / 2; objKeyboard.Left = targetPoints.X - 100; objKeyboard.ShowDialog(); return(strKeyText); } finally { this.Cursor = Cursors.Arrow; } }
public string DisplayKeyboard(string keyText, string type) { _sKeyText = ""; using (var objKeyboard = new KeyboardInterface()) { objKeyboard.Closing += ObjKeyboardClosing; objKeyboard.KeyString = keyText; objKeyboard.WindowStartupLocation = WindowStartupLocation.CenterScreen; // objKeyboard.Owner = CprintprmTick; objKeyboard.ShowDialog(); } return(_sKeyText); }
public string DisplayKeyboard(string keyText, string type) { _sKeyText = ""; var objKeyboard = new KeyboardInterface(); if (type == "Pwd") { objKeyboard.IsPwd = true; } objKeyboard.Closing += ObjKeyboardClosing; objKeyboard.KeyString = keyText; objKeyboard.Top = Top + Height - objKeyboard.Height; objKeyboard.Left = Left + Width / 2 - objKeyboard.Width / 2; objKeyboard.ShowDialog(); return(_sKeyText); }
private string DisplayKeyboard(string keyText, string type) { s_KeyText = ""; var objKeyboard = new KeyboardInterface(); if (type == "Pwd") { objKeyboard.IsPwd = true; } objKeyboard.Closing += ObjKeyboardClosing; objKeyboard.KeyString = keyText; Point locationFromScreen = this.PointToScreen(new Point(0, 0)); PresentationSource source = PresentationSource.FromVisual(this); System.Windows.Point targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); objKeyboard.Top = targetPoints.Y + this.Height / 2; objKeyboard.Left = targetPoints.X; objKeyboard.ShowDialog(); return(s_KeyText); }
public string DisplayKeyboard(string keyText) { strKeyText = ""; KeyboardInterface objKeyboard = null; try { Window w = Window.GetWindow(this); Point pt = default(Point); Size sz = default(Size); if (w != null) { pt = new Point(w.Left, w.Top); sz = new Size(w.Width, w.Height); } objKeyboard = new KeyboardInterface(); objKeyboard.Owner = w; objKeyboard.Closing += new System.ComponentModel.CancelEventHandler(objKeyboard_Closing); objKeyboard.KeyString = keyText; objKeyboard.Top = pt.Y + (sz.Height - objKeyboard.Height); objKeyboard.Left = pt.X + (sz.Width / 2) - (objKeyboard.Width / 2); objKeyboard.ShowInTaskbar = false; objKeyboard.ShowDialog(); if (objKeyboard != null) { objKeyboard.Closing -= this.objKeyboard_Closing; } } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { } return(strKeyText); }
private string DisplayKeyboard(string KeyText, string type) { strKeyText = ""; KeyboardInterface objKeyboard = new KeyboardInterface(); if (type == "Pwd") { objKeyboard.IsPwd = true; } objKeyboard.Closing += new System.ComponentModel.CancelEventHandler(objKeyboard_Closing); objKeyboard.KeyString = KeyText; Point locationFromScreen = this.PointToScreen(new Point(0, 0)); PresentationSource source = PresentationSource.FromVisual(this); System.Windows.Point targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); objKeyboard.Top = targetPoints.Y + this.Height / 2; objKeyboard.Left = targetPoints.X; objKeyboard.ShowDialog(); return strKeyText; }
public string DisplayKeyboard(string keyText) { strKeyText = ""; KeyboardInterface objKeyboard = null; try { Window w = Window.GetWindow(this); Point pt = default(Point); Size sz = default(Size); if (w != null) { pt = new Point(w.Left, w.Top); sz = new Size(w.Width, w.Height); } objKeyboard = new KeyboardInterface(); objKeyboard.Owner = w; objKeyboard.Closing += new System.ComponentModel.CancelEventHandler(objKeyboard_Closing); objKeyboard.KeyString = keyText; objKeyboard.Top = pt.Y + (sz.Height - objKeyboard.Height); objKeyboard.Left = pt.X + (sz.Width / 2) - (objKeyboard.Width / 2); objKeyboard.ShowInTaskbar = false; objKeyboard.ShowDialog(); if (objKeyboard != null) { objKeyboard.Closing -= this.objKeyboard_Closing; } } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { } return strKeyText; }
public string DisplayKeyboard(string keyText, string type) { _sKeyText = ""; using (var objKeyboard = new KeyboardInterface()) { objKeyboard.Closing += ObjKeyboardClosing; objKeyboard.KeyString = keyText; objKeyboard.WindowStartupLocation = WindowStartupLocation.CenterScreen; // objKeyboard.Owner = CprintprmTick; objKeyboard.ShowDialog(); } return _sKeyText; }
public string DisplayKeyboard(string keyText, string type) { _sKeyText = ""; var objKeyboard = new KeyboardInterface(); if (type == "Pwd") { objKeyboard.IsPwd = true; } objKeyboard.Closing += ObjKeyboardClosing; objKeyboard.KeyString = keyText; objKeyboard.Top = Top + Height - objKeyboard.Height; objKeyboard.Left = Left + Width / 2 - objKeyboard.Width / 2; objKeyboard.ShowDialog(); return _sKeyText; }