当前位置: 首页>>代码示例>>C#>>正文


C# TextBox.SetValue方法代码示例

本文整理汇总了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);
 }
开发者ID:wcordeiro,项目名称:MobileApplications,代码行数:33,代码来源:IngredientsSearch.xaml.cs

示例2: TextBoxHelper

 public TextBoxHelper(TextBox textBox)
 {
     textBox.TextChanged += (o, a) =>
         {
             textBox.SetValue(BindableTextProperty, textBox.Text);
         };
 }
开发者ID:brentedwards,项目名称:Charmed,代码行数:7,代码来源:TextBoxHelper.cs

示例3: SetBindableText

		public static void SetBindableText(TextBox element, string value)
		{
			if (element != null)
			{
				element.SetValue(BindableTextProperty, value);
			}
		}
开发者ID:kamilkk,项目名称:MyVote,代码行数:7,代码来源:TextBoxHelper.cs

示例4: SetAlwaysScrollToEnd

        public static void SetAlwaysScrollToEnd(TextBox textBox, bool alwaysScrollToEnd)
        {
            if (textBox == null)
                throw new ArgumentNullException(nameof(textBox));

            textBox.SetValue(AlwaysScrollToEndProperty, alwaysScrollToEnd);
        }
开发者ID:Jark,项目名称:FTDISample,代码行数:7,代码来源:TextBoxUtilities.cs

示例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();
 }
开发者ID:wcordeiro,项目名称:MobileApplications,代码行数:18,代码来源:AdvancedSearch.xaml.cs

示例6: SetIsAutoUpdate

 public static void SetIsAutoUpdate(TextBox obj, bool value)
 {
     obj.SetValue(IsAutoUpdateProperty, value);
 }
开发者ID:paraneye,项目名称:WinApp,代码行数:4,代码来源:TextBox.cs

示例7: SetRealTimeText

 public static void SetRealTimeText(TextBox obj, string value)
 {
     obj.SetValue(RealTimeTextProperty, value);
 }
开发者ID:paraneye,项目名称:WinApp,代码行数:4,代码来源:TextBox.cs

示例8: SetBindingSource

 public static void SetBindingSource(TextBox element, string value)
 {
     element.SetValue(BindingSourceProperty, value);
 }
开发者ID:ntierontime,项目名称:Log4Net,代码行数:4,代码来源:TextBoxUpdateSourceBehaviour.cs

示例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;
                            }
开发者ID:iot-alex,项目名称:virtual-shields-universal,代码行数:67,代码来源:Screen.cs


注:本文中的Windows.UI.Xaml.Controls.TextBox.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。