本文整理汇总了C#中Windows.UI.Xaml.Controls.TextBox.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.SetValue方法的具体用法?C# TextBox.SetValue怎么用?C# TextBox.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.SetValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addImage_Tapped
private void addImage_Tapped(object sender, TappedRoutedEventArgs e)
{
numIngredients++;
TextBox newTxtBox = new TextBox();
newTxtBox.Name = "Ingredient"+ numIngredients;
newTxtBox.Margin = new Thickness(10, 0, 0, 0);
if (!flagColumn)
{
newTxtBox.SetValue(Grid.RowProperty, addImage.GetValue(Grid.RowProperty));
newTxtBox.SetValue(Grid.ColumnProperty, 0);
IngredientsGrid.RowDefinitions.Add(new RowDefinition());
addImage.SetValue(Grid.RowProperty, ((int)addImage.GetValue(Grid.RowProperty) + 1));
}
else
{
newTxtBox.SetValue(Grid.RowProperty, lastRow);
newTxtBox.SetValue(Grid.ColumnProperty, 1);
lastRow++;
}
IngredientsGrid.Children.Remove(addImage);
IngredientsGrid.UpdateLayout();
IngredientsGrid.Children.Add(newTxtBox);
IngredientsGrid.UpdateLayout();
IngredientsGrid.Children.Add(addImage);
IngredientsGrid.UpdateLayout();
IngredientsPanel.UpdateLayout();
numberTxtBox++;
if(numberTxtBox % 4 == 0)
{
flagColumn = !flagColumn;
}
// IngredientsPanel.Children.Add(addImage);
}
示例2: TextBoxHelper
public TextBoxHelper(TextBox textBox)
{
textBox.TextChanged += (o, a) =>
{
textBox.SetValue(BindableTextProperty, textBox.Text);
};
}
示例3: SetBindableText
public static void SetBindableText(TextBox element, string value)
{
if (element != null)
{
element.SetValue(BindableTextProperty, value);
}
}
示例4: SetAlwaysScrollToEnd
public static void SetAlwaysScrollToEnd(TextBox textBox, bool alwaysScrollToEnd)
{
if (textBox == null)
throw new ArgumentNullException(nameof(textBox));
textBox.SetValue(AlwaysScrollToEndProperty, alwaysScrollToEnd);
}
示例5: addImage_Tapped
private void addImage_Tapped(object sender, TappedRoutedEventArgs e)
{
numIngredients++;
TextBox newTxtBox = new TextBox();
newTxtBox.Name = "AIngredient" + numIngredients;
newTxtBox.Margin = new Thickness(10, 0, 0, 0);
newTxtBox.SetValue(Grid.RowProperty, addImage.GetValue(Grid.RowProperty));
newTxtBox.SetValue(Grid.ColumnProperty, 0);
IngredientsGrid.RowDefinitions.Add(new RowDefinition());
addImage.SetValue(Grid.RowProperty, ((int)addImage.GetValue(Grid.RowProperty) + 1));
IngredientsGrid.Children.Remove(addImage);
IngredientsGrid.UpdateLayout();
IngredientsGrid.Children.Add(newTxtBox);
IngredientsGrid.UpdateLayout();
IngredientsGrid.Children.Add(addImage);
IngredientsGrid.UpdateLayout();
IngredientsPanel.UpdateLayout();
}
示例6: SetIsAutoUpdate
public static void SetIsAutoUpdate(TextBox obj, bool value)
{
obj.SetValue(IsAutoUpdateProperty, value);
}
示例7: SetRealTimeText
public static void SetRealTimeText(TextBox obj, string value)
{
obj.SetValue(RealTimeTextProperty, value);
}
示例8: SetBindingSource
public static void SetBindingSource(TextBox element, string value)
{
element.SetValue(BindingSourceProperty, value);
}
示例9: LcdPrint
//.........这里部分代码省略.........
element.Tapped += async (s, a) => await mainPage.SendEvent(s, a, "tapped");
break;
}
case "LINE":
{
var line = new Line
{
X1 = lcdt.X.Value,
Y1 = lcdt.Y.Value,
X2 = lcdt.X2.Value,
Y2 = lcdt.Y2.Value,
StrokeThickness = lcdt.Width ?? 1,
Stroke = foreground
};
element = line;
break;
}
case "INPUT":
{
element = new TextBox
{
Text = lcdt.Message,
FontSize = lcdt.Size ?? DefaultFontSize,
TextWrapping = TextWrapping.Wrap,
Foreground = textForgroundBrush,
AcceptsReturn = lcdt.Multi ?? false
};
expandToEdge = true;
element.SetValue(Canvas.LeftProperty, lcdt.X);
element.SetValue(Canvas.TopProperty, lcdt.Y);
element.LostFocus += async (s, a) => await mainPage.SendEvent(s, a, "lostfocus", lcdt, ((TextBox)s).Text);
((TextBox)element).TextChanged += async (s, a) => await mainPage.SendEvent(s, a, "changed", lcdt, ((TextBox)s).Text);
break;
}
case "CHANGE":
{
var retrievedElement = GetId(lcdt.Pid.Value);
if (retrievedElement != null)
{
if (lcdt.ARGB != null)
{
var i = 0;
}
}
break;
}
case "RECTANGLE":
{
var rect = new Rectangle
{
Tag = lcdt.Tag,
Fill = backgroundBrush ?? gray
};
if (lcdt.Width.HasValue)
{
rect.Width = lcdt.Width.Value;
}