本文整理汇总了VB.NET中System.Windows.Automation.Provider.IRangeValueProvider.SetValue方法的典型用法代码示例。如果您正苦于以下问题:VB.NET IRangeValueProvider.SetValue方法的具体用法?VB.NET IRangeValueProvider.SetValue怎么用?VB.NET IRangeValueProvider.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了IRangeValueProvider.SetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SetValue
''' <summary>
''' Sets the value of the control.
''' </summary>
''' <param name="value">
''' The value to set the control to.
''' </param>
''' <remarks>
''' For the purposes of this sample, the custom control displays
''' its value through the alpha setting of its base color.
''' </remarks>
Public Sub SetValue(ByVal value As Double) Implements IRangeValueProvider.SetValue
If value < Minimum Or value > Maximum Then
Throw New ArgumentOutOfRangeException()
Else
Dim color As Color = customControl.controlColor
' Invoke control method on separate thread to avoid
' clashing with UI.
' Use anonymous method for simplicity.
Me.customControl.Invoke(New MethodInvoker(Sub()
customControl.controlColor = Color.FromArgb(CInt(Fix(value)), color)
customControl.Refresh()
End Sub))
End If
End Sub