本文整理匯總了VB.NET中System.Windows.Forms.Integration.PropertyMap.Item屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET PropertyMap.Item屬性的具體用法?VB.NET PropertyMap.Item怎麽用?VB.NET PropertyMap.Item使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Forms.Integration.PropertyMap
的用法示例。
在下文中一共展示了PropertyMap.Item屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: ExtendBackColorMapping
' The ExtendBackColorMapping method adds a property
' translator if a mapping already exists.
Private Sub ExtendBackColorMapping()
If elemHost.PropertyMap("BackColor") IsNot Nothing Then
elemHost.PropertyMap("BackColor") = PropertyTranslator.Combine( _
elemHost.PropertyMap("BackColor"), _
PropertyTranslator.CreateDelegate( _
GetType(PropertyTranslator), _
Me, _
"OnBackColorChange"))
End If
End Sub
' The OnBackColorChange method assigns a specific image
' to the hosted element's Background property.
Private Sub OnBackColorChange( _
ByVal h As Object, _
ByVal propertyName As String, _
ByVal value As Object)
Dim host As ElementHost = h
Dim wpfButton As System.Windows.Controls.Button = host.Child
Dim b As New ImageBrush(New BitmapImage( _
New Uri("file:///C:\WINDOWS\Santa Fe Stucco.bmp")))
wpfButton.Background = b
End Sub
示例2: ExtendBackgroundMapping
' The ExtendBackgroundMapping method adds a property
' translator if a mapping already exists.
Private Sub ExtendBackgroundMapping()
If wfHost.PropertyMap("Background") IsNot Nothing Then
wfHost.PropertyMap("Background") = PropertyTranslator.Combine( _
wfHost.PropertyMap("Background"), _
PropertyTranslator.CreateDelegate( _
GetType(PropertyTranslator), _
Me, _
"OnBackgroundChange"))
End If
End Sub
' The OnBackgroundChange method assigns a specific image
' to the hosted control's BackgroundImage property.
Private Sub OnBackgroundChange(ByVal h As Object, ByVal propertyName As String, ByVal value As Object)
Dim host As WindowsFormsHost = h
Dim cb As System.Windows.Forms.CheckBox = host.Child
Dim b As ImageBrush = value
If Not (b Is Nothing) Then
cb.BackgroundImage = New System.Drawing.Bitmap("C:\WINDOWS\Santa Fe Stucco.bmp")
End If
End Sub