private void OnCandidateWindowBoundsChanged(TextBox sender, CandidateWindowBoundsChangedEventArgs args) { textBox1.Margin = new Thickness { Left = 0, Top = 0, Right = 0, Bottom = Math.Max(0, args.Bounds.Bottom - textBox1.ActualHeight) }; }
private void textBox_CandidateWindowBoundsChanged(TextBox sender, CandidateWindowBoundsChangedEventArgs args) { }
/// <summary> /// Gets the Rect that defines the size and location of the Input Method Editor (IME) /// window, in the coordinate space of the text edit control. /// </summary> /// <param name="e">The requested <see cref="CandidateWindowBoundsChangedEventArgs"/>.</param> /// <returns>The Rect that defines the size and location of the IME window.</returns> public static Rect Bounds(this CandidateWindowBoundsChangedEventArgs e) => Resolver.Bounds(e);
Rect ICandidateWindowBoundsChangedEventArgsResolver.Bounds(CandidateWindowBoundsChangedEventArgs e) => e.Bounds;
private void TextBox3_CandidateWindowBoundsChanged(TextBox sender, CandidateWindowBoundsChangedEventArgs args) { // CandidateWindowBoundsChangedEventArgs.Bounds - 获取 IME 窗口的 Rect 对象 textBlock3.Text += "CandidateWindowBoundsChanged: " + args.Bounds.ToString(); textBlock3.Text += Environment.NewLine; }