本文整理汇总了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