本文整理汇总了C#中System.Windows.Controls.TextBox.ScrollToHorizontalOffset方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.ScrollToHorizontalOffset方法的具体用法?C# TextBox.ScrollToHorizontalOffset怎么用?C# TextBox.ScrollToHorizontalOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.ScrollToHorizontalOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupCustomUIElements
public override void SetupCustomUIElements(dynNodeView view)
{
//add a button to the inputGrid on the dynElement
var readFileButton = new DynamoNodeButton
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Top,
Height = Configurations.PortHeightInPixels
};
readFileButton.Click += readFileButton_Click;
readFileButton.Content = "Browse...";
readFileButton.HorizontalAlignment = HorizontalAlignment.Stretch;
readFileButton.VerticalAlignment = VerticalAlignment.Center;
var tb = new TextBox();
if (string.IsNullOrEmpty(Value))
Value = "No file selected.";
tb.HorizontalAlignment = HorizontalAlignment.Stretch;
tb.VerticalAlignment = VerticalAlignment.Center;
var backgroundBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));
tb.Background = backgroundBrush;
tb.BorderThickness = new Thickness(0);
tb.IsReadOnly = true;
tb.IsReadOnlyCaretVisible = false;
tb.TextChanged += delegate {
tb.ScrollToHorizontalOffset(double.PositiveInfinity);
view.ViewModel.DynamoViewModel.ReturnFocusToSearch();
};
tb.Margin = new Thickness(0,5,0,5);
var sp = new StackPanel();
sp.Children.Add(readFileButton);
sp.Children.Add(tb);
view.inputGrid.Children.Add(sp);
tb.DataContext = this;
var bindingVal = new Binding("Value")
{
Mode = BindingMode.TwoWay,
Converter = new FilePathDisplayConverter()
};
tb.SetBinding(TextBox.TextProperty, bindingVal);
}