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


C# Control.SetValue方法代码示例

本文整理汇总了C#中Control.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Control.SetValue方法的具体用法?C# Control.SetValue怎么用?C# Control.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Control的用法示例。


在下文中一共展示了Control.SetValue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetIsTemplateFocusTarget

 /// <summary>
 /// Sets the value of the IsTemplateFocusTargetProperty attached property on a control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The property value.</param>
 /// <remarks>
 /// When a control is navigated to using the keyboard, a focus adorner is shown - usually
 /// around the control itself. However if the TemplatedControl.IsTemplateFocusTarget 
 /// attached property is set to true on an element in the control template, then the focus
 /// adorner will be shown around that control instead.
 /// </remarks>
 public void SetIsTemplateFocusTarget(Control control, bool value)
 {
     control.SetValue(IsTemplateFocusTargetProperty, value);
 }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:15,代码来源:TemplatedControl.cs

示例2: SetWidth

 public static void SetWidth(Control control, double value)
 {
     control.SetValue(WidthProperty, value);
 }
开发者ID:Arlorean,项目名称:Perspex,代码行数:4,代码来源:Design.cs

示例3: SetDataContext

 public static void SetDataContext(Control control, object value)
 {
     control.SetValue(DataContextProperty, value);
 }
开发者ID:Arlorean,项目名称:Perspex,代码行数:4,代码来源:Design.cs

示例4: SetDock

 /// <summary>
 /// Sets the value of the Dock attached property on the specified control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value of the Dock property.</param>
 public static void SetDock(Control control, Dock value)
 {
     control.SetValue(DockProperty, value);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:9,代码来源:DockPanel.cs

示例5: SetHeight

 public static void SetHeight(Control control, double value)
 {
     control.SetValue(HeightProperty, value);
 }
开发者ID:Arlorean,项目名称:Perspex,代码行数:4,代码来源:Design.cs

示例6: SetNameScope

 /// <summary>
 /// Sets the value of the attached <see cref="NameScopeProperty"/> on a visual.
 /// </summary>
 /// <param name="visual">The visual.</param>
 /// <param name="value">The value to set.</param>
 public static void SetNameScope(Control visual, INameScope value)
 {
     visual.SetValue(NameScopeProperty, value);
 }
开发者ID:Arlorean,项目名称:Perspex,代码行数:9,代码来源:NameScope.cs

示例7: SetTip

 /// <summary>
 /// Sets the value of the ToolTip.Tip attached property.
 /// </summary>
 /// <param name="element">The control to get the property from.</param>
 /// <param name="value">The content to be displayed in the control's tooltip.</param>
 public static void SetTip(Control element, object value)
 {
     element.SetValue(TipProperty, value);
 }
开发者ID:MarkWalls,项目名称:Perspex,代码行数:9,代码来源:ToolTip.cs

示例8: SetForeground

 /// <summary>
 /// Sets the value of the attached <see cref="ForegroundProperty"/> on a control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The property value to set.</param>
 /// <returns>The font family.</returns>
 public static void SetForeground(Control control, Brush value)
 {
     control.SetValue(ForegroundProperty, value);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:10,代码来源:TextBlock.cs

示例9: SetFontWeight

 /// <summary>
 /// Sets the value of the attached <see cref="FontWeightProperty"/> on a control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The property value to set.</param>
 /// <returns>The font family.</returns>
 public static void SetFontWeight(Control control, FontWeight value)
 {
     control.SetValue(FontWeightProperty, value);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:10,代码来源:TextBlock.cs

示例10: SetFontStyle

 /// <summary>
 /// Sets the value of the attached <see cref="FontStyleProperty"/> on a control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The property value to set.</param>
 /// <returns>The font family.</returns>
 public static void SetFontStyle(Control control, FontStyle value)
 {
     control.SetValue(FontStyleProperty, value);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:10,代码来源:TextBlock.cs

示例11: SetFontSize

 /// <summary>
 /// Sets the value of the attached <see cref="FontSizeProperty"/> on a control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The property value to set.</param>
 /// <returns>The font family.</returns>
 public static void SetFontSize(Control control, double value)
 {
     control.SetValue(FontSizeProperty, value);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:10,代码来源:TextBlock.cs

示例12: SetFontFamily

 /// <summary>
 /// Sets the value of the attached <see cref="FontFamilyProperty"/> on a control.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The property value to set.</param>
 /// <returns>The font family.</returns>
 public static void SetFontFamily(Control control, string value)
 {
     control.SetValue(FontFamilyProperty, value);
 }
开发者ID:abdelkarim,项目名称:Perspex,代码行数:10,代码来源:TextBlock.cs


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