本文整理汇总了C#中System.Windows.Controls.TextBox.Measure方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.Measure方法的具体用法?C# TextBox.Measure怎么用?C# TextBox.Measure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.Measure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAdornment
private UIElement CreateAdornment(string text)
{
var textBox = new TextBox();
textBox.Text = text;
textBox.BorderThickness = new Thickness(1);
textBox.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
textBox.Foreground = Brushes.Black;
textBox.FontWeight = FontWeights.Bold;
return textBox;
}
示例2: AddNavigateToPoint
private void AddNavigateToPoint(IWpfTextViewLineCollection textViewLines, SnapshotPoint point, string key)
{
_navigateMap[key] = point;
var resourceDictionary = _editorFormatMap.GetProperties(EasyMotionNavigateFormatDefinition.Name);
var span = new SnapshotSpan(point, 1);
var bounds = textViewLines.GetCharacterBounds(point);
var textBox = new TextBox();
textBox.Text = key;
textBox.FontFamily = _classificationFormatMap.DefaultTextProperties.Typeface.FontFamily;
textBox.Foreground = resourceDictionary.GetForegroundBrush(EasyMotionNavigateFormatDefinition.DefaultForegroundBrush);
textBox.Background = resourceDictionary.GetBackgroundBrush(EasyMotionNavigateFormatDefinition.DefaultBackgroundBrush);
textBox.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
Canvas.SetTop(textBox, bounds.TextTop);
Canvas.SetLeft(textBox, bounds.Left);
Canvas.SetZIndex(textBox, 10);
_adornmentLayer.AddAdornment(span, _tag, textBox);
}