如何使用VB.Net添加XAML代码? [英] How can I add XAML code using VB.Net?

查看:199
本文介绍了如何使用VB.Net添加XAML代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用VB.Net?

解决方案

添加XAML代码或更改XAML文件中的某个值?大多数.NET Framework 3.5 MSDN文档包括XAML,Visual Basic .NET和C#中的示例。例如,请查看 UIElement.MouseEnter事件上的页面。这使得很容易看到XAML如何与Visual Basic .NET和C#进行交互。

从以上链接获取示例代码:

XAML




























< tr>
< StackPanel >
< 边框 MouseEnter = " OnMouseEnterHandler"
MouseLeave = " OnMouseLeaveHandler" ;
名称 = " ; border1" Margin = " 10"
BorderThickness = " 1" ;
BorderBrush = " ;黑色"
< font style ="color:red"> VerticalAlignment = " Center" < font style ="font-size:11px">
宽度 = " 300" 高度 = " 100" >
< color:blue">" 10" FontSize = " 14"
Horizo​​ntalAlignment = " Center" >将光标移到我身上 < / 标签 >
< / B.订单 >
< / StackPanel >

How can I add XAML code or change one of the values in a XAML file using VB.Net?

解决方案

Most of the .NET Framework 3.5 MSDN documentation includes samples in XAML, Visual Basic .NET and C#.  For example, check out the page on UIElement.MouseEnter Event.  This makes it easy to see how XAML interacts with both Visual Basic .NET and C#.

Taking the sample code from the above link:

XAML

<StackPanel> 
  <Border MouseEnter="OnMouseEnterHandler" 
          MouseLeave="OnMouseLeaveHandler" 
          Name="border1" Margin="10" 
          BorderThickness="1" 
          BorderBrush="Black" 
          VerticalAlignment="Center" 
          Width="300" Height="100">  
    <Label Margin="10" FontSize="14" 
           HorizontalAlignment="Center">Move Cursor Over Me</Label> 
  </Border> 
</StackPanel> 


这篇关于如何使用VB.Net添加XAML代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆