本文整理匯總了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